feat:应急仓库
This commit is contained in:
parent
8207d882af
commit
0e2bff8038
|
|
@ -11,10 +11,10 @@ VITE_OPEN_PROXY = false
|
|||
|
||||
VITE_PROXY_API = /dev-api
|
||||
|
||||
# VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8040" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||
|
||||
# http://42.193.40.239:8017/doc.html//线上 http://192.168.110.186:8017/doc.html//本地
|
||||
VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||
|
||||
VITE_PROXY = [ ["/dev-api", "http://42.193.40.239:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||
# VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||
#
|
||||
VITE_GLOB_UPLOAD_URL=/dev-api
|
||||
VITE_UPLOAD_IMG_URL=/dev-img-api
|
||||
|
|
|
|||
|
|
@ -157,6 +157,16 @@ export function getOtheWareHousePage(data) {
|
|||
params: data
|
||||
});
|
||||
}
|
||||
/**
|
||||
*应急仓库详情
|
||||
*/
|
||||
export function getHouseDetail(houseId) {
|
||||
return request({
|
||||
url: `admin/OtheWareHouse/getOtheWareHouse`,
|
||||
method: "GET",
|
||||
params: { houseId }
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*应急仓库管理员列表
|
||||
|
|
@ -165,15 +175,15 @@ export function getHouseSysUser(userId) {
|
|||
return request({
|
||||
url: `admin/OtheWareHouse/getHouseSysUser`,
|
||||
method: "GET",
|
||||
params: {userId}
|
||||
params: { userId }
|
||||
});
|
||||
}
|
||||
/**
|
||||
*应急仓库添加-修改
|
||||
*/
|
||||
export function delOthpersonHouse(data) {
|
||||
export function saveOtheWareHouse(data) {
|
||||
return request({
|
||||
url: `admin/OtheWareHouse/delOthperson`,
|
||||
url: `admin/OtheWareHouse/saveOtheWareHouse`,
|
||||
method: "POST",
|
||||
data: data
|
||||
});
|
||||
|
|
|
|||
1
src/assets/icons/icon-statistic.svg
Normal file
1
src/assets/icons/icon-statistic.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16.017" viewBox="0 0 16 16.017"><defs><style>.a{fill:#b5c4e1;}.b{fill:#fff;opacity:0;}.c{clip-path:url(#a);}</style><clipPath id="a"><rect class="a" width="16" height="16.017"/></clipPath></defs><g transform="translate(-8913 -343.983)"><rect class="b" width="16" height="16" transform="translate(8913 344)"/><g transform="translate(8363 212.983)"><g transform="translate(550 131)"><g class="c"><path class="a" d="M963.789,137.567v-5.619a1.143,1.143,0,0,1,1.332-1.126,8,8,0,0,1,6.557,6.557,1.143,1.143,0,0,1-1.126,1.332h-5.619a1.143,1.143,0,0,1-1.143-1.143Zm0,0" transform="translate(-955.704 -130.81)"/><path class="a" d="M557.7,231.124h5.319a1.143,1.143,0,0,1,1.143,1.338,7.146,7.146,0,1,1-8.372-8.358,1.143,1.143,0,0,1,1.338,1.143v5.3a.572.572,0,0,0,.572.572Zm0,0" transform="translate(-549.999 -222.268)"/></g></g></g></g></svg>
|
||||
|
After Width: | Height: | Size: 933 B |
1
src/assets/icons/icon-trends.svg
Normal file
1
src/assets/icons/icon-trends.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><defs><style>.a{fill:#fff;opacity:0;}.b{fill:#b5c4e1;}</style></defs><g transform="translate(-865 -102)"><rect class="a" width="16" height="16" transform="translate(865 102)"/><g transform="translate(258 -145.367)"><path class="b" d="M618.152,253.66a.644.644,0,1,1,.589-.589.644.644,0,0,1-.589.589ZM623,248.715v9.871a.714.714,0,0,1-.714.715h-6.7v2.289h3.4a.584.584,0,0,1,.586.582.572.572,0,0,1-.572.561h-7.99a.584.584,0,0,1-.586-.58v-.006a.572.572,0,0,1,.572-.56h3.448V259.3H607.8l4.326-4.326,2.025,2.034a.572.572,0,0,0,.808,0l2.393-2.393a1.784,1.784,0,1,0-.81-.81l-1.985,1.986-1.986-1.983a.571.571,0,0,0-.8-.085.49.49,0,0,0-.045.041L607,258.49v-9.662a.828.828,0,0,1,.828-.828h14.455a.714.714,0,0,1,.715.714Zm0,0" transform="translate(0 0)"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 839 B |
1
src/assets/icons/icon-work.svg
Normal file
1
src/assets/icons/icon-work.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"><defs><style>.a{fill:#b5c4e1;}.b{fill:#fff;opacity:0;}.c{clip-path:url(#a);}</style><clipPath id="a"><rect class="a" width="16" height="16"/></clipPath></defs><g transform="translate(-8914 -324)"><rect class="b" width="16" height="16" transform="translate(8914 324)"/><g transform="translate(8286 115)"><g transform="translate(628 209)"><g class="c" transform="translate(0 0)"><path class="a" d="M628.481,367.9h1.771a.6.6,0,0,0,.6-.572.58.58,0,0,0-.6-.572h-1.771a.6.6,0,0,0-.6.572.582.582,0,0,0,.6.572Zm2.342,6.683a.58.58,0,0,0-.6-.572h-1.742a.6.6,0,0,0-.6.572.58.58,0,0,0,.6.572h1.771a.573.573,0,0,0,.572-.572Zm0,0" transform="translate(-627.883 -362.953)"/></g></g><path class="a" d="M695.564,221.031l-.257-.172a.592.592,0,0,1-.114-.828l1.456-1.8-.458-.371-1.485,1.8a.588.588,0,0,1-.828.085l-.228-.172,6.683-8.054a2.234,2.234,0,0,0-2.342-2.2H687.709a1.629,1.629,0,0,0-1.829,1.514v1.143h.886a1.568,1.568,0,0,1,1.543,1.514A1.441,1.441,0,0,1,686.853,215h-.971v4.2h.886a1.568,1.568,0,0,1,1.543,1.514,1.441,1.441,0,0,1-1.456,1.514h-.971V223.6a1.759,1.759,0,0,0,1.829,1.686h10.854a1.838,1.838,0,0,0,1.914-1.686v-8.485Zm-2.17,1.114c-.2.085-.714-.085-.685-.315l.6-1.8,1.829,1.456Zm0,0" transform="translate(-56.483 -0.312)"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
|
@ -36,15 +36,29 @@ export default {
|
|||
]
|
||||
},
|
||||
{
|
||||
path: 'resourse',
|
||||
name: 'resourse',
|
||||
component: () => import('@/views/emergency/matter/index.vue'),
|
||||
path: 'house',
|
||||
name: 'house',
|
||||
component: () => import('@/views/emergency/house/index.vue'),
|
||||
meta: {
|
||||
icon: 'point',
|
||||
auth: "emer.resourse",
|
||||
auth: "emer.house",
|
||||
title: '物资管理',
|
||||
breadcrumb: true, //是否显示面包屑
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'house-detail',
|
||||
name: 'house-detail',
|
||||
component: () => import('@/views/emergency/house/details.vue'),
|
||||
meta: {
|
||||
auth: "emer.house.detail",
|
||||
title: '仓库详情',
|
||||
sidebar: false, //是否在菜单栏显示
|
||||
breadcrumb: true, //是否显示面包屑
|
||||
activeMenu: '/emergency/house'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'shelter',
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export default {
|
|||
meta: {
|
||||
auth: "statistic",
|
||||
title: '统计分析',
|
||||
icon: 'point',
|
||||
icon: 'icon-statistic',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export default {
|
|||
meta: {
|
||||
auth: "daily",
|
||||
title: '工作管理',
|
||||
icon: 'point',
|
||||
icon: 'icon-work',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export default {
|
|||
meta: {
|
||||
auth: "trends",
|
||||
title: '工作动态',
|
||||
icon: 'point',
|
||||
icon: 'icon-trends',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,219 +0,0 @@
|
|||
<template>
|
||||
<div class="percentage-content">
|
||||
<div class="content">
|
||||
<div style="margin-bottom: 16px" class="h-layout space-between h-center">
|
||||
<div>
|
||||
<div class="h-layout">
|
||||
<div class="tool-item" @click="(dialogVisible = true), (form = {}),(readonly=false)">
|
||||
<svg-icon name="add" class="icon" />
|
||||
<span >新增</span>
|
||||
</div>
|
||||
<div class="tool-item" @click="getCompanyList">
|
||||
<svg-icon name="refurbish" class="icon" />
|
||||
<span>刷新</span>
|
||||
</div>
|
||||
<div class="tool-item" @click="getCompanyList">
|
||||
<svg-icon name="export" class="icon" />
|
||||
<span>导出</span>
|
||||
</div>
|
||||
<div v-if="tableCheckBoxs.length > 0" class="tool-item" @click="deletelist">
|
||||
<svg-icon name="delete" class="icon" />
|
||||
<span>删除</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 30%">
|
||||
<div>
|
||||
<el-input
|
||||
v-model="search"
|
||||
@keydown.enter.native="getCompanyList"
|
||||
placeholder="输入仓库名称"
|
||||
class="search-input"
|
||||
>
|
||||
<template #append>
|
||||
<span @click="getCompanyList" class="search-bottom">
|
||||
<svg-icon name="search" class="icon_class" />
|
||||
<span>搜索</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="loading"
|
||||
v-loading="tableDataloading"
|
||||
:data="tableData"
|
||||
header-row-class-name="el-one-header"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
>
|
||||
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
||||
<el-table-column type="index" align="center" label="序列" width="60"></el-table-column>
|
||||
<el-table-column
|
||||
prop="houseName"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="仓库名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="nameText"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="管理员"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.nameText }}({{ scope.row.possession }})
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="telephone"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="联系方式"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="possession"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="所属单位"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="地址"
|
||||
></el-table-column>
|
||||
<el-table-column :resizable="true" align="center" width="180" label="操作">
|
||||
<template #default="scope">
|
||||
<span class="operate" @click="
|
||||
(dialogVisible = true), (form = scope.row),(readonly=false)"
|
||||
>
|
||||
<svg-icon name="edit" class="icon"></svg-icon>
|
||||
<span class="edit">编辑</span>
|
||||
</span>
|
||||
<span class="operate" @click="
|
||||
(dialogVisible = true), (form = scope.row),(readonly=true)"
|
||||
>
|
||||
<svg-icon name="detail" class="icon"></svg-icon>
|
||||
<span class="detail">详情</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
class="pagination"
|
||||
@size-change="getCompanyList"
|
||||
@current-change="getCompanyList"
|
||||
v-model:current-page.sync="currentPage"
|
||||
:page-sizes="[10, 15, 20, 30]"
|
||||
v-model:page-size.sync="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
background
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 新增 -->
|
||||
<Adddetails :visible="dialogVisible" :form="form" :readonly="readonly" @close="onclone" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { getOtheWareHousePage,delOtheWareHouse } from "@/api/Othteam";
|
||||
import Adddetails from "./details.vue";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
const userStore = useUserStore();
|
||||
const user = ref(JSON.parse(userStore.userInfo));
|
||||
const userId = ref(user.value.userId)
|
||||
const search = ref([]);
|
||||
const tableData = ref([]);
|
||||
const currentPage = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const total = ref(0);
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const form = ref({});
|
||||
const readonly = ref(false);
|
||||
|
||||
//列表选中
|
||||
const tableCheckBoxs = ref([]);
|
||||
const handleSelectionChange = (val:any) => {
|
||||
tableCheckBoxs.value = [];
|
||||
for (let index = 0; index < val.length; index++) {
|
||||
const element = val[index];
|
||||
tableCheckBoxs.value.push(element.houseId);
|
||||
}
|
||||
};
|
||||
//获取列表
|
||||
const tableDataloading = ref(false);
|
||||
const getCompanyList = () => {
|
||||
tableDataloading.value = true;
|
||||
let params = {
|
||||
houseName: search.value,
|
||||
limit: pageSize.value,
|
||||
page: currentPage.value,
|
||||
};
|
||||
getOtheWareHousePage(params).then((res:any) => {
|
||||
tableData.value = res.data.list;
|
||||
total.value = res.data.total;
|
||||
tableDataloading.value = false;
|
||||
})
|
||||
};
|
||||
//删除列表
|
||||
const deletelist = () => {
|
||||
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||
confirmButtonText: "是",
|
||||
cancelButtonText: "否",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
let params = {
|
||||
houseId:tableCheckBoxs.value.join(", "),
|
||||
userId:userId.value
|
||||
}
|
||||
delOtheWareHouse(params).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
ElMessage.error({
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
getCompanyList();
|
||||
});
|
||||
});
|
||||
};
|
||||
//关闭新增弹窗
|
||||
const onclone = () => {
|
||||
dialogVisible.value = false;
|
||||
form.value = {};
|
||||
getCompanyList();
|
||||
};
|
||||
onMounted(() => {
|
||||
getCompanyList();
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
// flex: auto;
|
||||
background: #fff;
|
||||
border-radius: 0.26042vw;
|
||||
box-shadow: 0 0 0.41667vw 0 rgba(8, 33, 85, 0.1);
|
||||
height: 100%;
|
||||
padding: 0.83333vw;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden !important;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-o-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,322 +0,0 @@
|
|||
|
||||
<template>
|
||||
<BaseDialog
|
||||
:dialogVisible="props.visible"
|
||||
@close="onclone"
|
||||
:titleName="props.form.opInstructionId ? '编辑应急物资' : '新增应急物资'"
|
||||
width="50%"
|
||||
@onSubmit="handleSubmit"
|
||||
:footerclosed="true"
|
||||
:diafooter="true"
|
||||
:footerkeepnaem="props.readonly ? false : true"
|
||||
>
|
||||
<div class="detailForm-content">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
label-position="right"
|
||||
label-width="150px"
|
||||
:rules="ruleForm"
|
||||
:model="addPostFactorForm"
|
||||
>
|
||||
<el-form-item label="仓库名称:" prop="houseId">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入仓库名称"
|
||||
v-model="addPostFactorForm.houseId"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="装备名称:" prop="equname">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入装备名称"
|
||||
v-model="addPostFactorForm.equname"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="装备数量:" prop="equnum">
|
||||
<el-input-number
|
||||
:readonly="props.readonly"
|
||||
:min="0"
|
||||
:step="1"
|
||||
step-strictly
|
||||
v-model="addPostFactorForm.equnum"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="存放场所:" prop="storageplace">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入存放场所"
|
||||
v-model="addPostFactorForm.storageplace"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式:" prop="equphone">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入联系电话"
|
||||
v-model="addPostFactorForm.equphone"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属单位:" prop="possession">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入所属单位"
|
||||
v-model="addPostFactorForm.possession"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="行业领域:" prop="industry">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入行业领域"
|
||||
v-model="addPostFactorForm.industry"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型:" prop="equtype">
|
||||
<el-select
|
||||
:disabled="props.readonly"
|
||||
placeholder="请选择类型"
|
||||
v-model="addPostFactorForm.equtype"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in equtypes"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
:key="index"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="主要功能:" prop="equfunction" style="width: 100%">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入主要功能"
|
||||
v-model="addPostFactorForm.equfunction"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="装备照片:">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
ref="upload"
|
||||
action="#"
|
||||
accept="image/jpeg"
|
||||
list-type="picture-card"
|
||||
:show-file-list="false"
|
||||
:on-change="beforeAvatarUpload"
|
||||
:auto-upload="false"
|
||||
:http-request="handleUpload"
|
||||
:disabled="props.readonly"
|
||||
>
|
||||
<img
|
||||
v-if="addPostFactorForm.equipPhoto"
|
||||
:src="addPostFactorForm.equipPhoto"
|
||||
style="width: 100%; height: 100%"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</BaseDialog>
|
||||
</template>
|
||||
<script setup lang="ts" >
|
||||
import { reactive, ref, onMounted, watch } from "vue";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||
import { saveOthequipment, getOtheWareHouseList } from "@/api/Othteam";
|
||||
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const userStore = useUserStore();
|
||||
const user = ref(JSON.parse(userStore.userInfo));
|
||||
const userId = ref(user.value.userId);
|
||||
const uuid = ref("");
|
||||
const equtypes = ref([
|
||||
{
|
||||
value: "个人防护装备",
|
||||
label: "个人防护装备",
|
||||
},
|
||||
{
|
||||
value: "消防装备",
|
||||
label: "消防装备",
|
||||
},
|
||||
{
|
||||
value: "通信装备",
|
||||
label: "通信装备",
|
||||
},
|
||||
{
|
||||
value: "报警装备",
|
||||
label: "报警装备",
|
||||
},
|
||||
{
|
||||
value: "特殊专业性应急装备",
|
||||
label: "特殊专业性应急装备",
|
||||
},
|
||||
{
|
||||
value: "医疗救护装备",
|
||||
label: "医疗救护装备",
|
||||
},
|
||||
]);
|
||||
const ruleForm = reactive<FormRules>({
|
||||
houseId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择仓库名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
equname: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入装备名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
equnum: [
|
||||
{
|
||||
required: true,
|
||||
message: "请装备数量",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
storageplace: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入存放场所",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
equphone: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入联系电话",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
equtype: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择类型",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
});
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
form: Object,
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
id: String,
|
||||
});
|
||||
const listperformid = ref(props.id);
|
||||
const addPostFactorForm = ref(<any>{});
|
||||
const emits = defineEmits(["close", "onSubmit"]);
|
||||
//保存并退出
|
||||
const handleSubmit = () => {
|
||||
formRef.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
addPostFactorForm.value.othequipmentid =
|
||||
addPostFactorForm.value.othequipmentid || uuid.value;
|
||||
addPostFactorForm.value.userId = userId.value;
|
||||
saveOthequipment(addPostFactorForm.value).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
onclone();
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
// 上传附件前
|
||||
const upload = ref();
|
||||
const beforeAvatarUpload = () => {
|
||||
upload.value.submit();
|
||||
return true;
|
||||
};
|
||||
//图片上传
|
||||
const handleUpload = (res) => {
|
||||
let file = res.file;
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
let uuids = addPostFactorForm.value.othequipmentid || uuid.value;
|
||||
uploadFile(userId.value, uuids, FileType.equipment, formData).then(
|
||||
(res: any) => {
|
||||
if (res) {
|
||||
ElMessage.success({
|
||||
message: "上传成功!",
|
||||
type: "success",
|
||||
});
|
||||
getFiles();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
//图片查询
|
||||
const getFiles = () => {
|
||||
getFile(
|
||||
addPostFactorForm.value.othequipmentid || uuid.value,
|
||||
FileType.equipment
|
||||
).then((res: any) => {
|
||||
if (res.data.length > 0) {
|
||||
const path = res.data[res.data.length - 1];
|
||||
addPostFactorForm.value.equipPhoto =
|
||||
import.meta.env.VITE_UPLOAD_IMG_URL + path.filepath;
|
||||
}
|
||||
});
|
||||
};
|
||||
//关闭弹窗
|
||||
const onclone = () => {
|
||||
emits("close");
|
||||
};
|
||||
//获取仓库
|
||||
const houseNameList = ref([]);
|
||||
const OtheWareHouseList = () => {
|
||||
getOtheWareHouseList({}).then((res: any) => {
|
||||
houseNameList.value = res.data;
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
OtheWareHouseList();
|
||||
});
|
||||
watch(
|
||||
() => props.form,
|
||||
(val) => {
|
||||
uuid.value = getUUID();
|
||||
if (val) {
|
||||
if (!props.visible) return;
|
||||
addPostFactorForm.value = val;
|
||||
getFiles();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.detailForm-content {
|
||||
margin-right: 30px;
|
||||
}
|
||||
:deep(.el-form) {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
// justify-content: space-around;
|
||||
justify-content: space-between;
|
||||
}
|
||||
:deep(.el-form-item) {
|
||||
width: 47%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<!-- 表格1 -->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table
|
||||
ref="loading"
|
||||
:data="tableData"
|
||||
header-row-class-name="el-one-header"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
align="center"
|
||||
width="55"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="houseName"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="仓库名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equname"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="装备名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equnum"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="数量"
|
||||
width="70"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equtype"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="装备类型"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="storageplace"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="存放场所"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="industry"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="行业领域"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
:resizable="true"
|
||||
width="255"
|
||||
align="center"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
class="operate"
|
||||
@click="(row = scope.row), (addDialogVisible = true),(readonly=true)"
|
||||
>
|
||||
<svg-icon icon-class="detail"></svg-icon>
|
||||
<span class="detail">详情</span>
|
||||
</span>
|
||||
|
||||
<span class="operate" @click="del(scope.row)">
|
||||
<svg-icon class-name="icon-style" icon-class="delete" />
|
||||
<span class="detail">删除</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 分页 -->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-pagination
|
||||
class="pagination"
|
||||
@size-change="refresh"
|
||||
@current-change="refresh"
|
||||
:current-page.sync="currentPage"
|
||||
:page-sizes="[10, 15, 20, 30]"
|
||||
:page-size.sync="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
background
|
||||
>
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 装备弹窗 -->
|
||||
<add-warehouse
|
||||
:form="row"
|
||||
:isMaterial="false"
|
||||
:readonly="readonly"
|
||||
:visible="addDialogVisible"
|
||||
@close="(addDialogVisible = false), (read = false)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getEquipmentById, deleteEquip } from "@/api/emergency";
|
||||
import AddWarehouse from "./AddWarehouse.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
AddWarehouse,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addDialogVisible: false,
|
||||
row: {},
|
||||
readonly:false,
|
||||
// 分页
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
tableData: [],
|
||||
total: 0,
|
||||
selected: "",
|
||||
activeName: "first",
|
||||
command: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 库存列表
|
||||
getInventory(condition) {
|
||||
getEquipmentById(
|
||||
(this.houseId = this.$route.params.id),
|
||||
this.currentPage,
|
||||
this.pageSize,
|
||||
condition
|
||||
).then((res) => {
|
||||
this.tableData = res.data.rows;
|
||||
this.total = res.data.total;
|
||||
this.$loadingT(null, this.instance, "instance");
|
||||
});
|
||||
},
|
||||
//选中
|
||||
handleSelectionChange(val) {
|
||||
this.tableCheckBoxs = [];
|
||||
for (let index = 0; index < val.length; index++) {
|
||||
const element = val[index];
|
||||
this.tableCheckBoxs.push(element.listdetailid);
|
||||
}
|
||||
},
|
||||
//刷新
|
||||
refresh() {
|
||||
const loading = this.$refs["loading"];
|
||||
if (!this.instance) this.instance = this.$loadingT(loading);
|
||||
else return;
|
||||
this.getInventory();
|
||||
},
|
||||
// 删除
|
||||
del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
deleteEquip(row.othequipmentid).then((res) => {
|
||||
if (res.code == 1) {
|
||||
this.$message({
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
});
|
||||
this.getInventory();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getInventory();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
422
src/views/emergency/house/details.vue
Normal file
422
src/views/emergency/house/details.vue
Normal file
|
|
@ -0,0 +1,422 @@
|
|||
<template>
|
||||
<div class="percentage-content">
|
||||
<div class="content">
|
||||
<div>
|
||||
<TitleC titleName="仓库信息">
|
||||
<template v-slot:option>
|
||||
<div class="h-layout option">
|
||||
<div class="h-layout h-titlec" @click="getDetail">
|
||||
<svg-icon name="refurbish" class="icon" />
|
||||
<span class="span">刷新</span>
|
||||
</div>
|
||||
<div
|
||||
class="h-layout h-titlec"
|
||||
@click="resetPwd"
|
||||
v-if="formEnable"
|
||||
>
|
||||
<svg-icon name="save-yellow" class="icon" />
|
||||
<span class="span">编辑</span>
|
||||
</div>
|
||||
<div v-else class="h-layout h-titlec" @click="handleSumit(1)">
|
||||
<svg-icon name="save-yellow" class="icon" />
|
||||
<span class="span">保存</span>
|
||||
</div>
|
||||
<div class="h-layout h-titlec" @click="clone">
|
||||
<svg-icon name="close" class="icon" />
|
||||
<span class="span">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</TitleC>
|
||||
<div class="detailForm-content">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
label-position="right"
|
||||
label-width="150px"
|
||||
:rules="ruleForm"
|
||||
:model="detailForm"
|
||||
>
|
||||
<el-form-item label="仓库名称:" prop="houseName">
|
||||
<el-input
|
||||
:readonly="formEnable"
|
||||
placeholder="请输入仓库名称"
|
||||
v-model="detailForm.houseName"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理员:" prop="name">
|
||||
<el-input
|
||||
:readonly="formEnable"
|
||||
placeholder="请输入管理员"
|
||||
v-model="detailForm.name"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式:" prop="telephone">
|
||||
<el-input
|
||||
:readonly="formEnable"
|
||||
placeholder="请输入联系电话"
|
||||
v-model="detailForm.telephone"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属地区:" prop="orgCode">
|
||||
<el-cascader
|
||||
v-model="detailForm.orgCode"
|
||||
placeholder="请选择所属地区"
|
||||
@change="handleAreaChange"
|
||||
:options="orgList"
|
||||
:props="{
|
||||
checkStrictly: true,
|
||||
label: 'orgname',
|
||||
value: 'orgcode',
|
||||
}"
|
||||
clearable
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="经度:" prop="lon">
|
||||
<el-input
|
||||
:readonly="formEnable"
|
||||
placeholder="请输入经度"
|
||||
v-model="detailForm.lon"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="纬度:" prop="lat">
|
||||
<el-input
|
||||
:readonly="formEnable"
|
||||
placeholder="请输入维度"
|
||||
v-model="detailForm.lat"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="所属单位:"
|
||||
prop="possession"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-input
|
||||
:readonly="formEnable"
|
||||
placeholder="请输入所属单位"
|
||||
v-model="detailForm.possession"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="地址:" prop="address" style="width: 100%">
|
||||
<el-input
|
||||
:readonly="formEnable"
|
||||
placeholder="请输入详细地址"
|
||||
v-model="detailForm.address"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<TitleC titleName="仓库物资">
|
||||
<template v-slot:option>
|
||||
<div class="h-layout option">
|
||||
<div class="h-layout h-titlec" @click="getList">
|
||||
<svg-icon name="refurbish" class="icon" />
|
||||
<span class="span">刷新</span>
|
||||
</div>
|
||||
<div
|
||||
class="h-layout h-titlec"
|
||||
@click="(dialogVisible = true), (form = {}), (readonly = false)"
|
||||
>
|
||||
<svg-icon name="add" class="icon" />
|
||||
<span class="span">新建</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</TitleC>
|
||||
<el-table
|
||||
ref="loading"
|
||||
v-loading="tableDataloading"
|
||||
:data="tableData"
|
||||
header-row-class-name="el-one-header"
|
||||
border
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
align="center"
|
||||
label="序列"
|
||||
width="60"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equname"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="装备名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equnum"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="数量"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equtype"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="装备类型"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="storageplace"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="存放场所"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:resizable="true"
|
||||
align="center"
|
||||
width="260"
|
||||
label="操作"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span
|
||||
class="operate"
|
||||
@click="
|
||||
(dialogVisible = true), (form = scope.row), (readonly = false)
|
||||
"
|
||||
>
|
||||
<svg-icon name="edit" class="icon"></svg-icon>
|
||||
<span class="edit">编辑</span>
|
||||
</span>
|
||||
<span
|
||||
class="operate"
|
||||
@click="
|
||||
(dialogVisible = true), (form = scope.row), (readonly = true)
|
||||
"
|
||||
>
|
||||
<svg-icon name="detail" class="icon"></svg-icon>
|
||||
<span class="detail">详情</span>
|
||||
</span>
|
||||
<span class="operate" @click="delEquip(scope.row.othequipmentid)">
|
||||
<svg-icon name="delete" class="icon"></svg-icon>
|
||||
<span class="func">删除</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
class="pagination"
|
||||
@size-change="getList"
|
||||
@current-change="getList"
|
||||
v-model:current-page.sync="currentPage"
|
||||
:page-sizes="[10, 15, 20, 30]"
|
||||
v-model:page-size.sync="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
background
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 物资弹窗 -->
|
||||
<AddEquDialog
|
||||
:visible="dialogVisible"
|
||||
:form="form"
|
||||
:readonly="readonly"
|
||||
:id="houseId"
|
||||
@close="onclone"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { ElMessage, FormInstance, FormRules, ElMessageBox } from "element-plus";
|
||||
import AddEquDialog from "./dialog/add-equip-dialog.vue";
|
||||
import { areaTree } from "@/api/account";
|
||||
import {
|
||||
getHouseDetail,
|
||||
getOthequipmentPage,
|
||||
saveOtheWareHouse,
|
||||
delOthequipment,
|
||||
} from "@/api/Othteam";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRouter } from "vue-router";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
const userStore = useUserStore();
|
||||
const user = ref(JSON.parse(userStore.userInfo));
|
||||
const userId = ref(user.value.userId);
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const detailForm = ref<any>({});
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const ruleForm = reactive<FormRules>({
|
||||
houseName: [{ required: true, message: "请输入仓库名称", trigger: "blur" }],
|
||||
telephone: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入仓库管理员联系方式",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
orgCode: [
|
||||
{ required: true, message: "请选择仓库所属地区", trigger: "change" },
|
||||
],
|
||||
possession: [
|
||||
{ required: true, message: "请输入仓库所属单位", trigger: "blur" },
|
||||
],
|
||||
address: [{ required: true, message: "请输入仓库", trigger: "blur" }],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入仓库管理员",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
});
|
||||
const formEnable = ref(true);
|
||||
const readonly = ref(false);
|
||||
const tableDataloading = ref(false);
|
||||
const tableData = ref([]);
|
||||
|
||||
const houseId = ref();
|
||||
const form = ref({});
|
||||
const currentPage = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const total = ref(0);
|
||||
const dialogVisible = ref(false);
|
||||
|
||||
//编辑
|
||||
const resetPwd = () => {
|
||||
formEnable.value = false;
|
||||
};
|
||||
//保存
|
||||
const handleSumit = () => {
|
||||
formRef.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
detailForm.value.userId = userId.value;
|
||||
saveOtheWareHouse(detailForm.value).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
message: "保存成功",
|
||||
});
|
||||
formEnable.value = false;
|
||||
} else
|
||||
ElMessage.error({
|
||||
message: res.message,
|
||||
});
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
//关闭
|
||||
const clone = () => {
|
||||
router.go(-1);
|
||||
};
|
||||
//获取详情
|
||||
const getDetail = () => {
|
||||
getHouseDetail(route.query.id).then((res: any) => {
|
||||
detailForm.value = res.data;
|
||||
});
|
||||
};
|
||||
|
||||
//获取地区
|
||||
const orgList = ref([]);
|
||||
const getAreaTree = () => {
|
||||
areaTree(userId.value).then((res: any) => {
|
||||
orgList.value = res.data;
|
||||
});
|
||||
};
|
||||
|
||||
const handleAreaChange = (val) => {
|
||||
detailForm.value.orgCode =
|
||||
detailForm.value.orgCode[detailForm.value.orgCode.length - 1];
|
||||
};
|
||||
|
||||
//物资分页
|
||||
const getList = () => {
|
||||
tableDataloading.value = true;
|
||||
let params = {
|
||||
limit: pageSize.value,
|
||||
page: currentPage.value,
|
||||
houseId: houseId.value,
|
||||
};
|
||||
getOthequipmentPage(params).then((res: any) => {
|
||||
tableData.value = res.data.list;
|
||||
total.value = res.data.total;
|
||||
tableDataloading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
*删除
|
||||
*/
|
||||
const delEquip = (id) => {
|
||||
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||
confirmButtonText: "是",
|
||||
cancelButtonText: "否",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
delOthequipment(id, userId.value).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
message: "删除成功",
|
||||
});
|
||||
} else {
|
||||
ElMessage.error({
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
getList();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
//刷新
|
||||
const refurbish = () => {
|
||||
getDetail();
|
||||
};
|
||||
|
||||
//关闭弹窗
|
||||
const onclone = () => {
|
||||
dialogVisible.value = false;
|
||||
form.value = {};
|
||||
getList();
|
||||
};
|
||||
//编辑成员
|
||||
const editMember = (val) => {
|
||||
dialogVisible.value = true;
|
||||
form.value = val;
|
||||
};
|
||||
onMounted(() => {
|
||||
houseId.value = route.query.id || "";
|
||||
refurbish();
|
||||
|
||||
getAreaTree();
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
border-radius: 0.26042vw;
|
||||
box-shadow: 0 0 0.41667vw 0 rgba(8, 33, 85, 0.1);
|
||||
height: 100%;
|
||||
padding: 0.83333vw;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden !important;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-o-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.detailForm-content {
|
||||
margin-right: 30px;
|
||||
}
|
||||
:deep(.el-form) {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
:deep(.el-form-item) {
|
||||
width: 45%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -22,13 +22,13 @@
|
|||
label-position="right"
|
||||
label-width="150px"
|
||||
:rules="ruleForm"
|
||||
:model="addPostFactorForm"
|
||||
:model="addForm"
|
||||
>
|
||||
<el-form-item label="仓库名称:" prop="houseName">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入仓库名称"
|
||||
v-model="addPostFactorForm.houseName"
|
||||
v-model="addForm.houseName"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入装备名称"
|
||||
v-model="addPostFactorForm.equname"
|
||||
v-model="addForm.equname"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -46,14 +46,14 @@
|
|||
:min="0"
|
||||
:step="1"
|
||||
step-strictly
|
||||
v-model="addPostFactorForm.equnum"
|
||||
v-model="addForm.equnum"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="存放场所:" prop="storageplace">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入存放场所"
|
||||
v-model="addPostFactorForm.storageplace"
|
||||
v-model="addForm.storageplace"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入联系电话"
|
||||
v-model="addPostFactorForm.equphone"
|
||||
v-model="addForm.equphone"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入所属单位"
|
||||
v-model="addPostFactorForm.possession"
|
||||
v-model="addForm.possession"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入行业领域"
|
||||
v-model="addPostFactorForm.industry"
|
||||
v-model="addForm.industry"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
<el-select
|
||||
:disabled="props.readonly"
|
||||
placeholder="请选择类型"
|
||||
v-model="addPostFactorForm.equtype"
|
||||
v-model="addForm.equtype"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in equtypes"
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入主要功能"
|
||||
v-model="addPostFactorForm.equfunction"
|
||||
v-model="addForm.equfunction"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -117,8 +117,8 @@
|
|||
:disabled="props.readonly"
|
||||
>
|
||||
<img
|
||||
v-if="addPostFactorForm.equipPhoto"
|
||||
:src="baseImgUrl + addPostFactorForm.equipPhoto"
|
||||
v-if="addForm.equipPhoto"
|
||||
:src="baseImgUrl + addForm.equipPhoto"
|
||||
style="width: 100%; height: 100%"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
|
|
@ -228,16 +228,17 @@ const props = defineProps({
|
|||
id: String,
|
||||
});
|
||||
const listperformid = ref(props.id);
|
||||
const addPostFactorForm = ref(<any>{});
|
||||
const addForm = ref(<any>{});
|
||||
const emits = defineEmits(["close", "onSubmit"]);
|
||||
//保存并退出
|
||||
const handleSubmit = () => {
|
||||
formRef.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
addPostFactorForm.value.othequipmentid =
|
||||
addPostFactorForm.value.othequipmentid || uuid.value;
|
||||
addPostFactorForm.value.userId = userId.value;
|
||||
saveOthequipment(addPostFactorForm.value).then((res: any) => {
|
||||
addForm.value.othequipmentid = addForm.value.othequipmentid || uuid.value;
|
||||
addForm.value.userId = userId.value;
|
||||
addForm.value.houseId = props.id;
|
||||
|
||||
saveOthequipment(addForm.value).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
message: "保存成功",
|
||||
|
|
@ -266,7 +267,7 @@ const handleUpload = (res) => {
|
|||
let file = res.file;
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
let uuids = addPostFactorForm.value.othequipmentid || uuid.value;
|
||||
let uuids = addForm.value.othequipmentid || uuid.value;
|
||||
uploadFile(userId.value, uuids, FileType.equipment, formData).then(
|
||||
(res: any) => {
|
||||
if (res) {
|
||||
|
|
@ -281,16 +282,15 @@ const handleUpload = (res) => {
|
|||
};
|
||||
//图片查询
|
||||
const getFiles = () => {
|
||||
getFile(
|
||||
addPostFactorForm.value.othequipmentid || uuid.value,
|
||||
FileType.equipment
|
||||
).then((res: any) => {
|
||||
getFile(addForm.value.othequipmentid || uuid.value, FileType.equipment).then(
|
||||
(res: any) => {
|
||||
if (res.data.length > 0) {
|
||||
const path = res.data[res.data.length - 1];
|
||||
addPostFactorForm.value.equipPhoto =
|
||||
addForm.value.equipPhoto =
|
||||
import.meta.env.VITE_UPLOAD_URL + path.filepath;
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
//关闭弹窗
|
||||
const onclone = () => {
|
||||
|
|
@ -305,7 +305,7 @@ watch(
|
|||
uuid.value = getUUID();
|
||||
if (val) {
|
||||
if (!props.visible) return;
|
||||
addPostFactorForm.value = val;
|
||||
addForm.value = val;
|
||||
getFiles();
|
||||
}
|
||||
}
|
||||
|
|
@ -3,12 +3,12 @@
|
|||
<BaseDialog
|
||||
:dialogVisible="props.visible"
|
||||
@close="onclone"
|
||||
:titleName="props.form.opInstructionId ? '编辑应急仓库' : '新增应急仓库'"
|
||||
:titleName="props.form.houseId ? '编辑应急仓库' : '新增应急仓库'"
|
||||
width="50%"
|
||||
@onSubmit="handleSubmit"
|
||||
:footerclosed="true"
|
||||
:diafooter="true"
|
||||
:footerkeepnaem='props.readonly?false:true'
|
||||
:footerkeepnaem="props.readonly ? false : true"
|
||||
>
|
||||
<div class="detailForm-content">
|
||||
<el-form
|
||||
|
|
@ -25,23 +25,12 @@
|
|||
v-model="addPostFactorForm.houseName"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理员:" prop="nameId">
|
||||
<el-select
|
||||
v-model="addPostFactorForm.nameId"
|
||||
placeholder="请选择管理员"
|
||||
filterable
|
||||
remote
|
||||
:remote-method="remoteMethod"
|
||||
@change="adminOption"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in adminOptions"
|
||||
:key="item.userId"
|
||||
:value="item.userId"
|
||||
:label="item.chinaname + '(' + item.performclassname + ')'"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-form-item label="管理员:" prop="name">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入管理员"
|
||||
v-model="addPostFactorForm.name"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式:" prop="telephone">
|
||||
<el-input
|
||||
|
|
@ -71,30 +60,20 @@
|
|||
v-model="addPostFactorForm.lon"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="维度:" prop="lat">
|
||||
<el-form-item label="纬度:" prop="lat">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入维度"
|
||||
v-model="addPostFactorForm.lat"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属单位:" prop="possession">
|
||||
<el-form-item label="所属单位:" prop="possession" style="width: 100%">
|
||||
<el-input
|
||||
:readonly="props.readonly"
|
||||
placeholder="请输入所属单位"
|
||||
v-model="addPostFactorForm.possession"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
label="装备总数:"
|
||||
v-if="props.form && Object.keys(props.form).length > 0"
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
:readonly="props.readonly"
|
||||
v-model="addPostFactorForm.houseTotal"
|
||||
></el-input>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="地址:" prop="address" style="width: 100%">
|
||||
<el-input
|
||||
|
|
@ -103,17 +82,6 @@
|
|||
v-model="addPostFactorForm.address"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
label="二维码:"
|
||||
v-if="props.form && Object.keys(props.form).length > 0"
|
||||
>
|
||||
<img
|
||||
width="200px"
|
||||
height="200px"
|
||||
:src="addPostFactorForm.qrCode"
|
||||
alt=""
|
||||
/>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</div>
|
||||
</BaseDialog>
|
||||
|
|
@ -123,7 +91,11 @@ import { reactive, ref, onMounted, watch } from "vue";
|
|||
import useUserStore from "@/store/modules/user";
|
||||
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||
import { delOthpersonHouse, getOtheWareHouseList,getHouseSysUser } from "@/api/Othteam";
|
||||
import {
|
||||
saveOtheWareHouse,
|
||||
getOtheWareHouseList,
|
||||
getHouseSysUser,
|
||||
} from "@/api/Othteam";
|
||||
import { areaTree } from "@/api/account";
|
||||
const formRef = ref<FormInstance>();
|
||||
const userStore = useUserStore();
|
||||
|
|
@ -149,12 +121,12 @@ const ruleForm = reactive<FormRules>({
|
|||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择仓库管理员",
|
||||
message: "请输入仓库管理员",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
});
|
||||
const adminOptions = ref([])
|
||||
const adminOptions = ref([]);
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
|
|
@ -174,29 +146,32 @@ const emits = defineEmits(["close", "onSubmit"]);
|
|||
const handleSubmit = () => {
|
||||
formRef.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
// addPostFactorForm.value.chinaname = adminId.value;
|
||||
addPostFactorForm.value.houseId =
|
||||
addPostFactorForm.value.houseId || uuid.value;
|
||||
addPostFactorForm.value.userId = userId.value;
|
||||
delOthpersonHouse(addPostFactorForm.value).then((res: any) => {
|
||||
saveOtheWareHouse(addPostFactorForm.value).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
onclone();
|
||||
}
|
||||
} else
|
||||
ElMessage.error({
|
||||
message: res.message,
|
||||
type: "success",
|
||||
});
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
// 政府用户列表
|
||||
// 政府用户列表
|
||||
const getGovUserList = () => {
|
||||
getHouseSysUser(userId.value).then((res:any) => {
|
||||
getHouseSysUser(userId.value).then((res: any) => {
|
||||
adminOptions.value = res.data;
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
//获取地区
|
||||
const orgList = ref([]);
|
||||
const getareaTree = () => {
|
||||
|
|
@ -205,22 +180,23 @@ const getareaTree = () => {
|
|||
});
|
||||
};
|
||||
const handleAreaChange = (val) => {
|
||||
addPostFactorForm.value.orgCode = addPostFactorForm.value.orgCode[addPostFactorForm.value.orgCode.length - 1];
|
||||
addPostFactorForm.value.orgCode =
|
||||
addPostFactorForm.value.orgCode[addPostFactorForm.value.orgCode.length - 1];
|
||||
addPostFactorForm.value.streetCode = val[1] || "";
|
||||
addPostFactorForm.value.communityCode = val[2] || "";
|
||||
}
|
||||
};
|
||||
|
||||
//选择管理员数据处理
|
||||
const condition =ref('')
|
||||
const condition = ref("");
|
||||
const remoteMethod = (val) => {
|
||||
condition.value = val;
|
||||
getGovUserList();
|
||||
}
|
||||
};
|
||||
//选择管理员数据处理
|
||||
const adminId =ref('')
|
||||
const adminId = ref("");
|
||||
const adminOption = (val) => {
|
||||
adminId.value = val;
|
||||
}
|
||||
};
|
||||
//关闭弹窗
|
||||
const onclone = () => {
|
||||
emits("close");
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<el-input
|
||||
v-model="search"
|
||||
@keydown.enter.native="getList"
|
||||
placeholder="请输入关键字"
|
||||
placeholder="输入仓库名称"
|
||||
class="search-input"
|
||||
>
|
||||
<template #append>
|
||||
|
|
@ -40,9 +40,13 @@
|
|||
v-loading="tableDataloading"
|
||||
:data="tableData"
|
||||
header-row-class-name="el-one-header"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
align="center"
|
||||
width="55"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
type="index"
|
||||
align="center"
|
||||
|
|
@ -56,42 +60,28 @@
|
|||
label="仓库名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equname"
|
||||
prop="nameText"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="装备名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equnum"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="数量"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="equtype"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="装备类型"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="storageplace"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="存放场所"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="industry"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="行业领域"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:resizable="true"
|
||||
align="center"
|
||||
width="260"
|
||||
label="操作"
|
||||
label="管理员"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.nameText || "-" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="telephone"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="联系方式"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="地址"
|
||||
></el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="scope">
|
||||
<span
|
||||
class="operate"
|
||||
|
|
@ -102,16 +92,11 @@
|
|||
<svg-icon name="edit" class="icon"></svg-icon>
|
||||
<span class="edit">编辑</span>
|
||||
</span>
|
||||
<span
|
||||
class="operate"
|
||||
@click="
|
||||
(dialogVisible = true), (form = scope.row), (readonly = true)
|
||||
"
|
||||
>
|
||||
<span class="operate" @click="toDetail(scope.row.houseId)">
|
||||
<svg-icon name="detail" class="icon"></svg-icon>
|
||||
<span class="detail">详情</span>
|
||||
</span>
|
||||
<span class="operate" @click="deletelist(scope.row.othequipmentid)">
|
||||
<span class="operate" @click="del(scope.row.houseId)">
|
||||
<svg-icon name="delete" class="icon"></svg-icon>
|
||||
<span class="func">删除</span>
|
||||
</span>
|
||||
|
|
@ -132,7 +117,7 @@
|
|||
>
|
||||
</el-pagination>
|
||||
<!-- 新增 -->
|
||||
<AddWarehouse
|
||||
<AddDetails
|
||||
:visible="dialogVisible"
|
||||
:form="form"
|
||||
:readonly="readonly"
|
||||
|
|
@ -144,13 +129,16 @@
|
|||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { getOthequipmentPage, delOthequipment } from "@/api/Othteam";
|
||||
import AddWarehouse from "./add-edit-dialog.vue";
|
||||
import { getOtheWareHousePage, delOtheWareHouse } from "@/api/Othteam";
|
||||
import AddDetails from "./dialog/add-house-dialog.vue";
|
||||
|
||||
import useUserStore from "@/store/modules/user";
|
||||
import { useRouter } from "vue-router";
|
||||
const router = useRouter();
|
||||
|
||||
const userStore = useUserStore();
|
||||
const user = ref(JSON.parse(userStore.userInfo));
|
||||
const userId = ref(user.value.userId);
|
||||
|
||||
const search = ref([]);
|
||||
const tableData = ref([]);
|
||||
const currentPage = ref(1);
|
||||
|
|
@ -161,32 +149,33 @@ const dialogVisible = ref(false);
|
|||
const form = ref({});
|
||||
const readonly = ref(false);
|
||||
|
||||
const handleSelectionChange = () => {};
|
||||
//获取列表
|
||||
const tableDataloading = ref(false);
|
||||
const getList = () => {
|
||||
tableDataloading.value = true;
|
||||
let params = {
|
||||
equname: search.value,
|
||||
equtype: null,
|
||||
houseId: null,
|
||||
houseName: search.value,
|
||||
limit: pageSize.value,
|
||||
page: currentPage.value,
|
||||
};
|
||||
getOthequipmentPage(params).then((res: any) => {
|
||||
getOtheWareHousePage(params).then((res: any) => {
|
||||
tableData.value = res.data.list;
|
||||
total.value = res.data.total;
|
||||
tableDataloading.value = false;
|
||||
});
|
||||
};
|
||||
//删除列表
|
||||
const deletelist = (id) => {
|
||||
const del = (id) => {
|
||||
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||
confirmButtonText: "是",
|
||||
cancelButtonText: "否",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
delOthequipment(id, userId.value).then((res: any) => {
|
||||
let params = {
|
||||
houseId: id,
|
||||
userId: userId.value,
|
||||
};
|
||||
delOtheWareHouse(params).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
message: "删除成功",
|
||||
|
|
@ -206,12 +195,19 @@ const deletelist = (id) => {
|
|||
const onclone = () => {
|
||||
dialogVisible.value = false;
|
||||
form.value = {};
|
||||
getList();
|
||||
};
|
||||
//调整详情
|
||||
const toDetail = (id) => {
|
||||
router.push({
|
||||
name: "house-detail",
|
||||
query: { id: id },
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
|
|
@ -179,7 +179,7 @@ const todetail = (id) => {
|
|||
});
|
||||
};
|
||||
|
||||
//关闭职清单详情弹窗
|
||||
//关闭详情弹窗
|
||||
const onclone = () => {
|
||||
dialogVisible.value = false;
|
||||
form.value = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user