Commit 972f2df6 by T

预案功能更改、新增装备模块化、维修管理及bug修复

parent 3b760e6b
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676505193471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3844" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M737.148 541.92h-256.85V286.073c0-17.673-14.327-32-32-32h-288.85c-17.673 0-32 14.327-32 32v576.698c0 17.673 14.327 32 32 32h577.7c17.673 0 32-14.327 32-32V573.92c0-17.673-14.327-32-32-32z m-320.85-223.847V541.92h-224.85V318.073h224.85z m-224.85 288.85h224.85v223.848h-224.85V606.923z m513.7 223.848h-224.85V605.92h224.85v224.851z" fill="" p-id="3845"></path><path d="M843.523 146.698h-280c-17.132 0-31.02 13.888-31.02 31.02v280c0 17.132 13.888 31.02 31.02 31.02h280c17.132 0 31.02-13.888 31.02-31.02v-280c0-17.132-13.888-31.02-31.02-31.02z m-31.019 280H594.543V208.737h217.961v217.961z" fill="" p-id="3846"></path><path d="M671.523 285.718h64v64h-64z" fill="" p-id="3847"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676505193471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3844" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M737.148 541.92h-256.85V286.073c0-17.673-14.327-32-32-32h-288.85c-17.673 0-32 14.327-32 32v576.698c0 17.673 14.327 32 32 32h577.7c17.673 0 32-14.327 32-32V573.92c0-17.673-14.327-32-32-32z m-320.85-223.847V541.92h-224.85V318.073h224.85z m-224.85 288.85h224.85v223.848h-224.85V606.923z m513.7 223.848h-224.85V605.92h224.85v224.851z" fill="" p-id="3845"></path><path d="M843.523 146.698h-280c-17.132 0-31.02 13.888-31.02 31.02v280c0 17.132 13.888 31.02 31.02 31.02h280c17.132 0 31.02-13.888 31.02-31.02v-280c0-17.132-13.888-31.02-31.02-31.02z m-31.019 280H594.543V208.737h217.961v217.961z" fill="" p-id="3846"></path><path d="M671.523 285.718h64v64h-64z" fill="" p-id="3847"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676505023922" class="icon" viewBox="0 0 1027 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2802" xmlns:xlink="http://www.w3.org/1999/xlink" width="200.5859375" height="200"><path d="M835.707408 791.0893c8.945488 8.935549 8.945488 23.039602-0.268365 32.52182-8.667184 8.408759-22.771238 8.408759-31.99503-0.546669l-140.434229-140.145985c-8.667184-8.935549-8.667184-23.039602 0.546669-32.253456 8.677124-8.677124 23.317907-8.677124 32.531759 0L835.707408 791.0893zM773.625718 0c14.640783 0 29.55987 1.083398 44.190713 4.601957 15.455816 2.713465 29.54993 7.325361 43.107315 13.020655 18.974375 8.130455 28.198167 30.633328 19.789408 50.154372a39.638453 39.638453 0 0 1-7.86209 11.927318c-29.013201 29.003261-58.016462 57.748098-86.761299 86.751359l4.880261 17.354247 4.343532 17.622613 17.890977 4.88026 17.354247 4.611897c28.734897-29.003261 57.748098-57.479733 86.751359-86.761299 14.650722-14.909147 39.042087-14.909147 54.2196 0 4.343532 4.611896 7.593726 10.307191 9.223792 16.27085a195.558317 195.558317 0 0 1 11.658953 38.495418v0.546669h0.268365c2.703525 13.825749 4.343532 28.734897 4.343532 44.459078 0 60.998292-25.216338 117.116322-65.610188 157.788476-40.125485 40.39385-96.52182 65.341823-157.788477 65.341823-4.343532 0-8.677124-0.268365-13.020655-0.268364l-42.292282 41.745612L950.935238 721.145519l1.888492 2.166797a156.715018 156.715018 0 0 1 44.190713 109.254232c0 40.125485-15.177512 80.519335-46.089144 111.152663l-0.546669 0.546669c-30.901693 30.374903-70.490449 45.552415-110.615934 45.552415s-81.056065-15.177512-111.152663-46.099084l-233.159187-232.880882-237.741264 238.307812c-49.617642 49.607703-109.532536 53.951235-158.60351 32.810063-18.974375-7.86209-36.050318-19.789408-50.154371-33.893461h-0.268365c-14.094114-14.362479-25.753067-31.179997-33.615158-49.886007-21.141171-49.070974-16.807579-109.254232 33.078429-158.593571v-0.546669L313.290884 473.892219l-97.05855-97.058549-86.214629-25.753067a37.740022 37.740022 0 0 1-24.401305-21.419475L22.930269 135.822333c-7.593726-14.094114-5.148626-32.53176 6.778692-44.459078L64.407517 56.933064 98.569343 22.771238c10.575555-10.565616 27.114769-14.640783 41.755552-8.130455l196.283895 83.769529a37.571051 37.571051 0 0 1 21.68784 24.401305l25.484703 86.214629 97.058549 97.05855 69.675415-69.138686c-0.268365-4.880261-0.546669-9.492157-0.546668-13.010716h0.268364c0-62.08169 24.947973-118.19972 65.341824-158.325206v-0.278304c40.383911-40.115546 96.511881-65.331884 158.046901-65.331884z m-109.532536 542.752601l-114.402857 114.412797 232.602578 232.602578c15.455816 15.724181 36.865352 23.854636 57.469793 23.854636s41.487187-8.130455 56.943004-23.586271l0.536729-0.268365c15.724181-15.177512 23.049542-36.596987 23.049542-57.201428 0-20.067712-7.325361-40.39385-21.966144-55.581302l-1.620127-1.620127-232.612518-232.612518zM366.963814 420.209349l59.914894-59.636589-103.837242-104.105607a38.525237 38.525237 0 0 1-10.297251-18.974375l-22.502873-76.185743L134.082932 95.428483l-15.992545 15.72418-15.992546 16.260911 66.425222 156.158409 78.620903 23.049542c6.510328 1.898431 11.927318 5.148626 16.27085 10.028887L366.963814 420.209349zM768.208728 76.454108a146.248796 146.248796 0 0 0-98.688616 43.375679 145.562976 145.562976 0 0 0-43.37568 104.105607h0.546669v10.575555l1.083398 8.945488c2.703525 11.927318-1.083398 24.938034-10.30719 34.430191L102.097841 792.987731h-0.268364c-23.854636 24.669669-26.568101 52.599472-16.807579 75.639074 4.065228 8.935549 10.307191 17.890977 17.622612 25.474764 7.86209 7.593726 16.539214 13.557385 26.031371 17.622612 23.039602 10.028886 50.701041 7.315422 75.092406-16.539214l264.060879-264.05094 1.083398-1.083398 168.085728-168.354092 1.083398-1.351763 80.7877-80.250971h0.268364c7.86209-8.677124 20.067712-13.010716 32.263395-11.112284 3.796863 0.536729 7.315422 1.083398 11.390589 1.083398 2.703525 0.268365 6.500388 0.546669 10.84392 0.546669 40.672154 0 77.537506-16.539214 104.105606-42.560646v-0.546669c25.216338-24.938034 41.208883-59.914894 42.570586-98.688616-16.539214 16.807579-33.078428 33.078428-49.617643 50.154371-9.482218 10.565616-23.854636 14.909147-38.495418 11.658954l-38.495419-10.575556-39.042087-10.565615c-13.020655-3.528498-23.586271-13.020655-27.11477-27.11477l-10.297251-39.042087-10.575555-39.042087c-2.981829-11.927318-0.268365-26.568101 10.038826-36.060258 17.056065-17.344308 34.141948-34.420252 51.496195-51.774499z" fill="#717071" p-id="2803"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676505023922" class="icon" viewBox="0 0 1027 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2802" xmlns:xlink="http://www.w3.org/1999/xlink" width="200.5859375" height="200"><path d="M835.707408 791.0893c8.945488 8.935549 8.945488 23.039602-0.268365 32.52182-8.667184 8.408759-22.771238 8.408759-31.99503-0.546669l-140.434229-140.145985c-8.667184-8.935549-8.667184-23.039602 0.546669-32.253456 8.677124-8.677124 23.317907-8.677124 32.531759 0L835.707408 791.0893zM773.625718 0c14.640783 0 29.55987 1.083398 44.190713 4.601957 15.455816 2.713465 29.54993 7.325361 43.107315 13.020655 18.974375 8.130455 28.198167 30.633328 19.789408 50.154372a39.638453 39.638453 0 0 1-7.86209 11.927318c-29.013201 29.003261-58.016462 57.748098-86.761299 86.751359l4.880261 17.354247 4.343532 17.622613 17.890977 4.88026 17.354247 4.611897c28.734897-29.003261 57.748098-57.479733 86.751359-86.761299 14.650722-14.909147 39.042087-14.909147 54.2196 0 4.343532 4.611896 7.593726 10.307191 9.223792 16.27085a195.558317 195.558317 0 0 1 11.658953 38.495418v0.546669h0.268365c2.703525 13.825749 4.343532 28.734897 4.343532 44.459078 0 60.998292-25.216338 117.116322-65.610188 157.788476-40.125485 40.39385-96.52182 65.341823-157.788477 65.341823-4.343532 0-8.677124-0.268365-13.020655-0.268364l-42.292282 41.745612L950.935238 721.145519l1.888492 2.166797a156.715018 156.715018 0 0 1 44.190713 109.254232c0 40.125485-15.177512 80.519335-46.089144 111.152663l-0.546669 0.546669c-30.901693 30.374903-70.490449 45.552415-110.615934 45.552415s-81.056065-15.177512-111.152663-46.099084l-233.159187-232.880882-237.741264 238.307812c-49.617642 49.607703-109.532536 53.951235-158.60351 32.810063-18.974375-7.86209-36.050318-19.789408-50.154371-33.893461h-0.268365c-14.094114-14.362479-25.753067-31.179997-33.615158-49.886007-21.141171-49.070974-16.807579-109.254232 33.078429-158.593571v-0.546669L313.290884 473.892219l-97.05855-97.058549-86.214629-25.753067a37.740022 37.740022 0 0 1-24.401305-21.419475L22.930269 135.822333c-7.593726-14.094114-5.148626-32.53176 6.778692-44.459078L64.407517 56.933064 98.569343 22.771238c10.575555-10.565616 27.114769-14.640783 41.755552-8.130455l196.283895 83.769529a37.571051 37.571051 0 0 1 21.68784 24.401305l25.484703 86.214629 97.058549 97.05855 69.675415-69.138686c-0.268365-4.880261-0.546669-9.492157-0.546668-13.010716h0.268364c0-62.08169 24.947973-118.19972 65.341824-158.325206v-0.278304c40.383911-40.115546 96.511881-65.331884 158.046901-65.331884z m-109.532536 542.752601l-114.402857 114.412797 232.602578 232.602578c15.455816 15.724181 36.865352 23.854636 57.469793 23.854636s41.487187-8.130455 56.943004-23.586271l0.536729-0.268365c15.724181-15.177512 23.049542-36.596987 23.049542-57.201428 0-20.067712-7.325361-40.39385-21.966144-55.581302l-1.620127-1.620127-232.612518-232.612518zM366.963814 420.209349l59.914894-59.636589-103.837242-104.105607a38.525237 38.525237 0 0 1-10.297251-18.974375l-22.502873-76.185743L134.082932 95.428483l-15.992545 15.72418-15.992546 16.260911 66.425222 156.158409 78.620903 23.049542c6.510328 1.898431 11.927318 5.148626 16.27085 10.028887L366.963814 420.209349zM768.208728 76.454108a146.248796 146.248796 0 0 0-98.688616 43.375679 145.562976 145.562976 0 0 0-43.37568 104.105607h0.546669v10.575555l1.083398 8.945488c2.703525 11.927318-1.083398 24.938034-10.30719 34.430191L102.097841 792.987731h-0.268364c-23.854636 24.669669-26.568101 52.599472-16.807579 75.639074 4.065228 8.935549 10.307191 17.890977 17.622612 25.474764 7.86209 7.593726 16.539214 13.557385 26.031371 17.622612 23.039602 10.028886 50.701041 7.315422 75.092406-16.539214l264.060879-264.05094 1.083398-1.083398 168.085728-168.354092 1.083398-1.351763 80.7877-80.250971h0.268364c7.86209-8.677124 20.067712-13.010716 32.263395-11.112284 3.796863 0.536729 7.315422 1.083398 11.390589 1.083398 2.703525 0.268365 6.500388 0.546669 10.84392 0.546669 40.672154 0 77.537506-16.539214 104.105606-42.560646v-0.546669c25.216338-24.938034 41.208883-59.914894 42.570586-98.688616-16.539214 16.807579-33.078428 33.078428-49.617643 50.154371-9.482218 10.565616-23.854636 14.909147-38.495418 11.658954l-38.495419-10.575556-39.042087-10.565615c-13.020655-3.528498-23.586271-13.020655-27.11477-27.11477l-10.297251-39.042087-10.575555-39.042087c-2.981829-11.927318-0.268365-26.568101 10.038826-36.060258 17.056065-17.344308 34.141948-34.420252 51.496195-51.774499z" fill="#717071" p-id="2803"></path></svg>
\ No newline at end of file
......@@ -31,9 +31,9 @@ import 'moment/locale/zh-cn'
Vue.prototype.$moment = moment
Vue.config.productionTip = false
// axios.defaults.baseURL = 'http://192.168.3.74:5001'
//axios.defaults.baseURL = 'http://192.168.3.74:5001'
//开发环境
//axios.defaults.baseURL = 'http://192.168.3.188:5007'
//axios.defaults.baseURL = 'http://192.168.3.188:5007'
//现场
axios.defaults.baseURL = 'http://41.204.124.248:5001'
......
......@@ -23,6 +23,13 @@ const borrow = [
}
,
{
//维修管理 - 入库表单接收
path: '/borrow/repairGet',
name: 'repairGet',
component: () => import('@/borrow/repairGet')
}
,
{
//
path: '/borrow/return',
name: 'return',
......
......@@ -43,6 +43,13 @@ const systemConfig = [
}
,
{
// 维修申请
path: '/systemConfig/repairApply',
name: 'systemConfig/repairApply',
component: () => import( '@/systemConfig/repairApply')
}
,
{
// 借用申请
path: '/systemConfig/borrowApply',
name: 'systemConfig/borrowApply',
......
......@@ -11,6 +11,13 @@ const warehouse = [
component: () => import('@/warehouse/cabinet')
},
{
//模块管理
path: '/warehouse/modularization',
name: 'modularization',
component: () => import('@/warehouse/modularization')
}
,
{
//预案管理
path: '/warehouse/emergencyPlan',
name: 'emergencyPlan',
......
......@@ -29,7 +29,7 @@ export default new Vuex.Store({
{
id: 1,
path: '/borrow',
menuName: '借领管理',
menuName: '业务管理',
icon: "iconfont icon-Home",
children: [
{
......@@ -43,6 +43,12 @@ export default new Vuex.Store({
path: '/borrow/borrowGet',
menuName: '借用管理',
},
{
id: 1-3,
path: '/borrow/repairGet',
menuName: '维修管理',
}
]
},
......
......@@ -85,7 +85,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -259,7 +259,7 @@
<th class="textHeader">视频查看</th>
<td class="textContentLast">
<video v-if="detailData.VideoUrl !=''&& detailData.VideoUrl !=null"
v-bind:src="'http://41.204.124.248:5001/' +detailData.videoUrl"
v-bind:src="'http://41.204.124.248:5001/' +detailData.VideoUrl"
class="avatar video-avatar"
controls="controls">
您的浏览器不支持视频播放
......@@ -478,7 +478,7 @@
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchData.page"
:current-page="searchData.Page"
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
......@@ -842,7 +842,10 @@ console.log("up")
});
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
......
......@@ -103,7 +103,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -660,7 +660,7 @@
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchData.page"
:current-page="searchData.Page"
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
......@@ -1326,9 +1326,11 @@ export default {
if(this.$route.query.IsPublicType!=undefined)
{ this.searchData.IsPublic=this.$route.query.IsPublicType;}
},
async getQueuData() {
async getQueuData(arg) {
// console.log("CC",this.$route.query.StateType)
if(arg) {
this.searchData.Page = 1
}
// console.log("statet",aa)
this.loading = true;
......@@ -1359,8 +1361,7 @@ export default {
// 每页显示条数发生改变时
handleSizeChange(val) {
this.searchData.Rows = val;
this.getQueuData();
this.getQueuData();
},
// 当前页数发生改变时
handleCurrentChange(val) {
......
<template>
<div class="body">
<!-- 面包屑导航区域 S -->
<div class="title_box">
<div class="block" style="float: left"></div>
<el-card style="height: 75px">
<el-row>
<el-col :span="2">
<img src="../../assets/images/维修.png" class="logo" alt="logo"
/></el-col>
<el-col :span="2"
><span class="fontStyle">维修管理</span><br /><span></span>
</el-col>
<el-col :span="20">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/index' }"
>首页</el-breadcrumb-item
>
<el-breadcrumb-item>业务管理</el-breadcrumb-item>
<el-breadcrumb-item>维修管理</el-breadcrumb-item>
</el-breadcrumb></el-col
>
</el-row>
</el-card>
</div>
<!-- 主体区域 - 卡片视图 -->
<div class="main_box">
<!-- 查询功能区域 -->
<el-form
:inline="true"
:model="searchData"
size="medium"
label-position="left"
>
<el-input
v-model="searchData.SubmitUserName"
@keypress.native.enter="onEnterPress"
ref="nameInput"
style="width: 200px"
class="textboxBo"
placeholder="请输入申请人员搜索"
></el-input>
<el-select
v-model="searchData.SubmitState"
class="textboxBo"
placeholder="请选择维修类型"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-form-item label="时间节点 :" class="mgr15 mgl15 textboxBo">
<el-date-picker
@change="dateChange"
v-model="timeData"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<a-button
type="primary"
ghost
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
>查询</a-button
>
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px; margin-left: 10px"
class="funcButton"
@click="addRecive(0)"
>维修下发(未贴标)</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addRecive(1)"
>维修下发(已贴标)</el-button
>
</el-form>
<!-- 列表区域 -->
<el-row style="margin-top: 30px">
<!-- 主表 -->
<el-table
v-loading="loading"
:data="borrowData"
stripe
style="width: 100%"
size="small"
border
highlight-current-row
>
<el-table-column prop="ID" v-if="false" />
<el-table-column
prop="SubmitUserName"
label="申请人"
align="center"
/>
<el-table-column
prop="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column
prop="IsHaoCai"
label="单据类型"
:formatter="stateFormat"
align="center"
/>
<el-table-column prop="DepartName" label="部 门" align="center" />
<el-table-column prop="SubmitReason" label="申请原因" align="center">
</el-table-column>
<el-table-column prop="SubmitTime" label="申请时间" align="center" />
<el-table-column
prop="ExamineUserName"
label="审核人"
align="center"
/>
<el-table-column prop="ExamineTime" label="审核时间" align="center" />
<el-table-column prop="LyTime" label="维修时间" align="center" />
<el-table-column
prop="SubmitStateName"
label="状 态"
align="center"
/>
<el-table-column
fixed="right"
label="操作"
align="center"
>
<template slot-scope="scope">
<a-button
@click="getDetailInfo(scope.row, 0)"
type="primary"
ghost
round
size="small"
v-if="scope.row.SubmitState !== 0"
style="font-size: 15px"
>查看</a-button
>
<a-button
type="primary"
class="actions"
v-if="[0].includes(scope.row.SubmitState)"
ghost
round
size="small"
@click="getDetailInfo(scope.row, 1)"
>审批</a-button
>
<!-- <a-button
type="primary"
class="actions"
v-if="[1].includes(scope.row.SubmitState)&&[1].includes(scope.row.IsHaoCai)"
ghost
round
size="small"
@click="borrowOut(scope.row, 2)"
>已出库</a-button
>
<a-button
type="primary"
class="actions"
v-if="[2].includes(scope.row.SubmitState)&&[1].includes(scope.row.IsHaoCai)"
ghost
round
size="small"
@click="borrowOut(scope.row, 3)"
>已入库</a-button
> -->
<a-button
type="primary"
class="actions"
v-if="[1].includes(scope.row.SubmitState)"
ghost
round
size="small"
@click="borrowOut(scope.row, 2)"
>已出库</a-button
>
<a-button
type="primary"
class="actions"
v-if="[2].includes(scope.row.SubmitState)"
ghost
round
size="small"
@click="borrowOut(scope.row, 3)"
>已入库</a-button
>
</template>
</el-table-column>
</el-table>
<!-- 详细信息弹出 -->
<!-- <div class="ivu-divider ivu-divider-horizontal"></div> -->
<el-dialog title="单据详情" :visible.sync="borrowTableVisible">
<el-card>
<div slot="header" class="clearfix" style="text-align: left">
<span class="labelBorrow">基础信息</span>
</div>
<div style="border: 1px solid #e8e8e8">
<table
style="
table-layout: auto;
width: 100%;
border-collapse: collapse;
box-sizing: border-box;
"
>
<tbody>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">维修人员</th>
<td class="textContent">
{{ detailData.SubmitUserName }}
</td>
<th class="textHeader">部 门</th>
<td class="textContent">
{{ detailData.DepartName }}
</td>
<th class="textHeader">审批人员</th>
<td class="textContentLast">
{{ detailData.ExamineUserName }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">审核时间</th>
<td class="textContent">
{{ detailData.ExamineTime }}
</td>
<th class="textHeader">维修时间</th>
<td class="textContent">
{{ detailData.LyTime ? detailData.LyTime : "暂无" }}
</td>
<th class="textHeader">单据状态</th>
<td class="textContentLast">
{{
detailData.SubmitStateName
? detailData.SubmitStateName
: "暂无"
}}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">申请时间</th>
<td class="textContent">
{{ detailData.SubmitTime }}
</td>
<th class="textHeader">申请理由</th>
<td colspan="5" class="textContentLast">
{{ detailData.SubmitReason }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">备注</th>
<td colspan="5" class="textContentLast">
{{ detailData.Remarks }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">审核意见</th>
<td colspan="5" class="textContentLast">
{{ detailData.ExameReason }}
</td>
</tr>
</tbody>
</table>
</div>
</el-card>
<el-card
class="box-card"
style="text-align: center; margin-top: 35px; text-align: left"
>
<label class="labelBorrow">维修装备表</label>
<el-divider></el-divider>
<template>
<el-table :data="tableData" border class="details">
<el-table-column
prop="MaterielName"
label="物料名称"
align="center"
>
</el-table-column>
<el-table-column
prop="NameAndCode"
label="装备名称"
align="center"
>
</el-table-column>
<el-table-column prop="EqSizeName" label="号型" align="center">
</el-table-column>
<el-table-column prop="LyCount" label="维修数量" align="center">
</el-table-column>
<el-table-column prop="OutTime" label="出库时间" align="center">
</el-table-column>
<el-table-column prop="ReturnTime" label="入时间" align="center">
</el-table-column>
</el-table>
</template>
</el-card>
<el-card v-if="auditbutton" class="box-card" style="margin-top: 35px">
<el-tag class="tagel" @click="tagSet('同意')" type="success"
>同意</el-tag
>
<el-tag
class="tagel"
@click="tagSet('申请理由充分、同意此次申请')"
type="success"
>申请理由充分、同意此次申请</el-tag
>
<el-tag
class="tagel"
@click="tagSet('所列项目齐全符合规范要求、同意此次申请')"
type="success"
>所列项目齐全符合规范要求、同意此次申请</el-tag
>
<el-tag class="tagel" @click="tagSet('不同意')" type="danger"
>不同意</el-tag
>
<el-tag
class="tagel"
@click="tagSet('申请理由不充分、请完善后重新提交.')"
type="danger"
>申请理由不充分、请完善后重新提交.</el-tag
>
<el-tag
class="tagel"
@click="tagSet('请数量有误、请检查后修改再次提交.')"
type="danger"
>申请数量有误、请检查后修改再次提交.</el-tag
>
<el-tag
class="tagel"
@click="tagSet('其他原因、驳回.')"
type="danger"
>其他原因、驳回.</el-tag
>
<el-input
class="labelClassT"
type="textarea"
:rows="2"
placeholder="请输入审核意见"
v-model="editForm.exameReason"
></el-input>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="borrowTableVisible = false">关闭</el-button>
<el-button v-if="auditbutton" @click="auditState(-1)" type="danger"
>不通过</el-button
>
<el-button v-if="auditbutton" @click="auditState(1)" type="success"
>通过</el-button
>
</div>
</el-dialog>
<!-- 新增/编辑 耗材 -->
<el-dialog
width="70%"
:close-on-click-modal="false"
:title="title"
:visible.sync="addVisible"
@close="closeForm('ruleForm')"
>
<div style="border: 0px solid #e8e8e8">
<el-divider></el-divider>
<el-form
:model="ruleForm"
ref="ruleForm"
label-width="100px"
style="margin-top: 10px; margin-bottom: 35px"
>
<el-row :gutter="10">
<el-col :span="8" class="dia">
<el-form class="diaC">大类选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MainClass"
filterable
clearable
style="width: 300px"
@change="getClass($event, 'hc')"
placeholder="请选择大类"
>
<el-option
v-for="item in classOption"
:key="item.ID"
:label="item.EqCategoryName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">物料选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MaterielId"
filterable
clearable
style="width: 300px"
@change="getMateriel"
placeholder="请选择物料"
>
<el-option
v-for="item in MaterielOption"
:key="item.ID"
:label="item.MaterielName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">号型选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.EqSizeId"
filterable
clearable
style="width: 300px"
@change="getIDAndName"
placeholder="请选择号型"
>
<el-option
v-for="item in sizeOption"
:key="item.ID"
:label="item.EqSizeName"
:value="item.ID"
>
</el-option>
</el-select>
<el-button
size="small"
class="buttonClass"
type="primary"
icon="el-icon-circle-plus-outline"
round
@click="addEquipment"
>添加装备</el-button
>
</el-col>
<el-col :span="16" style="padding-top: 31px">
<el-table
:data="ruleForm.BorrowList"
ref="BorrowList"
height="250"
border
style="width: 100%"
>
<el-table-column
prop="MaterielId"
label="物料ID"
align="center"
v-if="false"
>
</el-table-column>
<el-table-column
prop="EqSizeName"
label="号型名称"
align="center"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="物料名称"
align="center"
>
</el-table-column>
<el-table-column
prop="LyCount"
label="装备数量"
align="center"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.LyCount"
:min="1"
:max="200"
></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="deleteEquipment(scope.$index, scope.row)"
icon="el-icon-delete"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="10"> </el-col>
</el-row>
</el-form>
<el-divider style="margin-bottom: 35px"></el-divider>
<el-form
:model="ruleForm"
ref="ruleForm"
label-position="left"
style="margin-top: 30px"
>
<!-- class="inputClass" -->
<el-row :gutter="90" style="margin-top: 30px">
<el-col :span="8" style="padding-top: 42px">
<el-form-item style="padding-left: 12px" label="部门选择">
<treeselect
style="width: 247px; float: left; margin-left: 18px"
noOptionsText="暂无数据"
:options="departOptions"
placeholder="请选择上级部门"
:normalizer="normalizer"
@select="selectDepart"
/>
</el-form-item>
<el-form-item class="diaC"
>人员选择
<el-select
class="diaD"
v-model="ruleForm.userID"
placeholder="请选择人员"
@change="policeSelect"
>
<el-option
v-for="item in policeOptions"
:key="item.ID"
:label="item.UserName"
:value="item.ID"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="labelClass"
>备注
<el-input
type="textarea"
:autosize="{ minRows: 6, maxRows: 50 }"
v-model="ruleForm.Remarks"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm(1)">提交</el-button>
</span>
</el-dialog>
<!-- 新增/编辑 非耗材-->
<el-dialog
width="70%"
:close-on-click-modal="false"
:title="title"
:visible.sync="NHCaddVisible"
@close="closeForm('ruleForm')"
>
<div style="border: 0px solid #e8e8e8">
<el-divider></el-divider>
<el-form
:model="ruleForm"
ref="ruleForm"
label-width="100px"
style="margin-top: 10px; margin-bottom: 35px"
>
<el-row :gutter="10">
<el-col :span="8" class="dia">
<el-form class="diaC">大类选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MainClass"
filterable
clearable
style="width: 300px"
@change="getClass($event, 'nhc')"
placeholder="请选择大类"
>
<el-option
v-for="item in classOption"
:key="item.ID"
:label="item.EqCategoryName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">物料选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MaterielName"
filterable
clearable
style="width: 300px"
@change="getMateriel"
placeholder="请选择物料"
>
<el-option
v-for="item in MaterielOption"
:key="item.ID"
:label="item.MaterielName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">号型选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.EqSizeId"
filterable
clearable
style="width: 300px"
@change="getIDAndName"
placeholder="请选择号型"
>
<el-option
v-for="item in sizeOption"
:key="item.ID"
:label="item.EqSizeName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">装备选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.EquipmentId"
filterable
clearable
style="width: 300px"
@change="getEquipment"
placeholder="请选择具体装备"
>
<el-option
v-for="item in eqOption"
:key="item.ID"
:label="item.NameAndCode"
:value="item.ID"
>
</el-option>
</el-select>
<el-button
size="small"
class="buttonClass"
type="primary"
icon="el-icon-circle-plus-outline"
round
@click="addNHCEquipment"
>添加装备</el-button
>
</el-col>
<el-col :span="16" style="padding-top: 31px">
<el-table
:data="NHCruleForm.BorrowList"
ref="BorrowList"
height="250"
border
style="width: 100%"
>
<el-table-column
prop="MaterielId"
label="物料ID"
align="center"
v-if="false"
>
</el-table-column>
<el-table-column
prop="EqSizeName"
label="号型名称"
align="center"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="物料名称"
align="center"
>
</el-table-column>
<el-table-column
prop="NameAndCode"
label="装备名称"
align="center"
>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="deleteNHCEquipment(scope.$index, scope.row)"
icon="el-icon-delete"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="10"> </el-col>
</el-row>
</el-form>
<el-divider></el-divider>
<el-form
:model="NHCruleForm"
ref="NHCruleForm"
label-position="left"
style="margin-top: 30px"
>
<!-- class="inputClass" -->
<el-row :gutter="90" style="margin-top: 30px">
<el-col :span="8" style="padding-top: 42px">
<el-form-item style="padding-left: 12px" label="部门选择">
<treeselect
style="width: 247px; float: left; margin-left: 18px"
noOptionsText="暂无数据"
:options="departOptions"
placeholder="请选择上级部门"
:normalizer="normalizer"
@select="selectDepart"
/>
</el-form-item>
<el-form-item class="diaC"
>人员选择
<el-select
class="diaD"
v-model="ruleForm.userID"
placeholder="请选择人员"
@change="NHCpoliceSelect"
>
<el-option
v-for="item in policeOptions"
:key="item.ID"
:label="item.UserName"
:value="item.ID"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="labelClass"
>备注
<el-input
type="textarea"
:autosize="{ minRows: 6, maxRows: 50 }"
v-model="NHCruleForm.Remarks"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="NHCaddVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm(0)">提交</el-button>
</span>
</el-dialog>
<!-- 分页功能 -->
<el-row type="flex" justify="center" align="middle">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchData.page"
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
/>
</el-row>
</el-row>
</div>
</div>
</template>
<script>
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { Treeselect },
data() {
return {
loading: false,
searchData: {
Page: 1,
Rows: 10,
Sort: "ID",
Order: "ESC",
DepartName: "",
UserName: "",
IsAdmin: 1,
SubmitState: "0",
SubmitUserName: "",
borrowType: 2,
},
eqOption: [],
AddPlanForm: {
parentName: "",
parentId: "",
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EquipmentId: "",
EquipmentName: "",
},
searchEqCategoryData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
},
searchUserData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
DeparId: "",
},
title: "",
searchDepartmentData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
},
ruleForm: {
ID: 0,
PlanName: "",
PlanState: 0,
borrowType: 2,
IsHaoCai: 0,
submitUsrID: "",
submitUserName: "",
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielID: "",
EqSizeId: "",
EqSizeName: "",
LyCount: 1,
},
],
},
NHCruleForm: {
ID: 0,
PlanName: "",
PlanState: 0,
borrowType: 2,
IsHaoCai: 1,
submitUsrID: "",
submitUserName: "",
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielID: "",
EqSizeId: "",
EqSizeName: "",
LyCount: 1,
},
],
},
searchClassData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ESC",
CategoryID: "",
IsHaoCai: 1,
},
departOptions: [],
policeOptions: [],
classOption: [],
MaterielOption: [],
sizeOption: [],
resetForm() {
(this.eqOption = []),
(this.classOption = []),
(this.MaterielOption = []),
(this.sizeOption = []),
(this.AddPlanForm = {
parentName: "",
parentId: "",
MaterielName: "",
MainClass: "",
MaterielCode: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EqSizeCode: "",
}),
(this.ruleForm = {
ID: 0,
SubmitReason: "", //申请理由
Remarks: "", //备注
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EqSizeCode: "",
LyCount: 1,
},
],
});
(this.NHCruleForm = {
ID: 0,
SubmitReason: "", //申请理由
Remarks: "", //备注
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EqSizeCode: "",
LyCount: 1,
},
],
});
},
searchEquipmentData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ESC",
MaterielId: "",
EqSizeId: "",
State: 0,
IsNoBorrow: true
},
searchMaterielData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ESC",
MaterielId: "",
},
auditbutton: false,
editForm: {
ID: "",
SubmitState: 0,
exameReason: "",
},
addVisible: false,
NHCaddVisible: false,
// 日期配置
pickerOptions: {
shortcuts: [
{
text: "最近一日",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
// 用户选中日期
timeData: [],
// 时间选择器回调
options: [
{
value: "-99",
label: "全部",
},
{
value: "-2",
label: "待提交",
},
{
value: "-1",
label: "未通过",
},
{
value: "0",
label: "待审批",
},
{
value: "1",
label: "待出库",
},
{
value: "2",
label: "已出库",
},
{
value: "3",
label: "已入库",
},
],
valueType: "-99",
input: "",
form: {},
tableData: [],
detailData: [],
imgurl: [],
borrowData: [],
borrowTableVisible: false,
picVisible: false,
formLabelWidth: "120px",
history_Num: "",
// 总条数
total: 0,
normalizer(node) {
//去掉children=[]的children属性
if (node.Children && !node.Children.length) {
delete node.Children;
}
return {
id: node.ID,
//将name转换成必填的label键
label: node.DepartName,
children: node.Children,
};
},
};
},
created() {
this.searchData.SubmitState =
this.$route.query.SubmitState || this.searchData.SubmitState;
this.InitQuery();
this.getQueuData();
},
methods: {
// 获取当前选中部门的名称
async selectDepart(node) {
console.log(node);
this.AddPlanForm.parentName = node.DepartName;
this.AddPlanForm.parentId = node.ID;
this.searchUserData.DeparId = node.ID;
const { data: res } = await this.$axios.get("api/User", {
params: this.searchUserData,
});
this.policeOptions = res.Rows;
},
//获取号型的名字和ID
async getIDAndName(val) {
if (val !== "") {
var obj = {};
obj = this.sizeOption.find(function (item) {
return item.ID === val;
});
this.searchEquipmentData.EqSizeId = obj.ID;
const { data: eqres } = await this.$axios.get("api/Equipment", {
params: this.searchEquipmentData,
});
this.eqOption = eqres.Rows;
// console.log(obj)
this.AddPlanForm.EqSizeId = obj.ID;
this.AddPlanForm.EqSizeName = obj.EqSizeName;
this.AddPlanForm.EqSizeCode = obj.Code;
} else {
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
this.searchEquipmentData.EqSizeId = "";
this.searchEquipmentData.EqSizeName = "";
const { data: eqres } = await this.$axios.get("api/Equipment", {
params: this.searchEquipmentData,
});
this.eqOption = eqres.Rows;
}
},
//获取装备
async getEquipment(val) {
if (val !== "") {
var obj = {};
obj = this.eqOption.find(function (item) {
return item.ID === val;
});
this.AddPlanForm.EquipmentName=obj.NameAndCode;
this.AddPlanForm.EquipmentId = obj.ID;
this.AddPlanForm.NameAndCode = obj.NameAndCode;
this.AddPlanForm.epc = obj.LabelEpc;
console.log("val",this.AddPlanForm)
}
else
{
this.AddPlanForm.EquipmentId="";
this.AddPlanForm.EquipmentName="";
}
},
async InitQuery()
{
if(this.$route.query.options!=undefined)
{ this.searchData.SubmitState=this.$route.query.options;}
},
///提交表单
async submitForm(ishaocai) {
console.log("renyuan",this.NHCruleForm)
if (ishaocai === 0) {
//非耗材
if (this.NHCruleForm.BorrowList.length===0) {
return this.$message.warning("请添加装备");
}
if (!this.NHCruleForm.submitUsrID) {
return this.$message.warning("请选择人员");
}
this.NHCruleForm.IsHaoCai = ishaocai;
this.NHCruleForm.borrowType=2;
console.log("hc", this.NHCruleForm);
const borrowUrl = "/api/Borrow/AdminCreateBorrow";
const { data: res } = await this.$axios.post(borrowUrl, this.NHCruleForm);
this.searchData.SubmitState="1";
this.getQueuData();
this.NHCaddVisible = false;
if (res.Success !== true) return this.$message.error(res.Remark);
else
{
return this.$message.success(res.Remark);
}
} //耗材
else {
if (this.ruleForm.BorrowList.length===0) {
return this.$message.warning("请添加装备");
}
if (!this.ruleForm.submitUsrID) {
return this.$message.warning("请选择人员");
}
this.ruleForm.IsHaoCai = ishaocai;
this.ruleForm.borrowType=2;
const borrowUrl = "/api/Borrow/AdminCreateBorrow";
const { data: res } = await this.$axios.post(borrowUrl, this.ruleForm);
this.searchData.SubmitState="1";
this.getQueuData();
this.addVisible = false;
if (res.Success !== true) return this.$message.error(res.Remark);
else
{
return this.$message.success(res.Remark);
}
}
},
//物料选择后
async getMateriel(val) {
this.sizeOption=[];
this.eqOption=[];
this.AddPlanForm.EquipmentId = "";
this.AddPlanForm.NameAndCode = "";
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
this.searchMaterielData.MaterielId = val;
if (val !== "") {
var obj = {};
obj = this.MaterielOption.find(function (item) {
return item.ID === val;
});
this.AddPlanForm.MaterielId = obj.ID;
this.AddPlanForm.MaterielCode = obj.MaterielCode;
this.AddPlanForm.MaterielName = obj.MaterielName;
this.searchEquipmentData.MaterielId = obj.ID;
const { data: res } = await this.$axios.get("api/EqSize", {
params: this.searchMaterielData,
});
const { data: eqres } = await this.$axios.get("api/Equipment", {
params: this.searchEquipmentData,
});
this.sizeOption = res.Rows;
this.eqOption = eqres.Rows;
// console.log("size",this.sizeOption)
} else {
this.eqOption = [];
this.sizeOption = [];
this.AddPlanForm.MaterielId = "";
this.AddPlanForm.MaterielName = "";
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
this.AddPlanForm.EquipmentId = "";
this.AddPlanForm.NameAndCode = "";
}
},
///获取类别的ID和内容
async getClass(val, b) {
if (b === "hc") {
//耗材
this.searchClassData.IsHaoCai = 1;
} //非耗材
else {
this.searchClassData.IsHaoCai = 0;
}
this.AddPlanForm.MaterielName = "";
this.AddPlanForm.EqSizeId = "";
if (val !== "") {
this.searchClassData.CategoryID = val;
const { data: res } = await this.$axios.get("api/Materiel", {
params: this.searchClassData,
});
this.MaterielOption = res.Rows;
} else {
this.sizeOption = [];
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
}
},
closeForm() {
this.resetForm();
},
//添加非耗材装备
addNHCEquipment() {
// console.log("nhc",this.AddPlanForm.EquipmentId);
if (this.AddPlanForm.EquipmentId === "") {
this.$message.warning("请选择物资");
return;
}
var obj = {};
var plan = {
LyCount: 1,
MainClass: this.AddPlanForm.MainClass,
MaterielName: this.AddPlanForm.MaterielName,
MaterielID: this.AddPlanForm.MaterielId,
MaterielCode: this.AddPlanForm.MaterielCode,
EqSizeId: this.AddPlanForm.EqSizeId,
EqSizeName: this.AddPlanForm.EqSizeName,
EqSizeCode: this.AddPlanForm.EqSizeCode,
NameAndCode: this.AddPlanForm.NameAndCode,
EquipmentId: this.AddPlanForm.EquipmentId,
epc: this.AddPlanForm.epc,
};
console.log("添加物资", plan);
obj = this.NHCruleForm.BorrowList.find(function (item) {
return item.EquipmentId === plan.EquipmentId;
});
if (obj === undefined) {
this.NHCruleForm.BorrowList.push(plan);
} else {
this.$message.error("已经存在该物资");
}
},
//添加耗材装备
addEquipment() {
console.log("hc",this.AddPlanForm);
if (this.AddPlanForm.MaterielId === "") {
this.$message.warning("请选择物料类型");
return;
}
var obj = {};
var plan = {
LyCount: 1,
MainClass: this.AddPlanForm.MainClass,
MaterielName: this.AddPlanForm.MaterielName,
MaterielId: this.AddPlanForm.MaterielId,
MaterielCode: this.AddPlanForm.MaterielCode,
EqSizeId: this.AddPlanForm.EqSizeId,
EqSizeName: this.AddPlanForm.EqSizeName,
EqSizeCode: this.AddPlanForm.EqSizeCode,
};
console.log("添加物资", plan);
obj = this.ruleForm.BorrowList.find(function (item) {
return item.EqSizeId === plan.EqSizeId;
});
if (obj === undefined) {
this.ruleForm.BorrowList.push(plan);
// this.AddPlanForm.EqSizeId="";
// this.AddPlanForm.EqSizeName="";
} else {
this.$message.error("已经存在该物资");
}
},
//删除装备
deleteEquipment(row) {
this.ruleForm.BorrowList.splice(row, 1);
},
deleteNHCEquipment(row) {
this.NHCruleForm.BorrowList.splice(row, 1);
},
stateFormat(row) {
if (row.IsHaoCai === 0) {
return "已贴标";
} else if(row.IsHaoCai===1) {
return "未贴标";
}
else
{
return "";
}
},
SubmitFormat(row) {
if (row.SubmitState === 1) {
return "待出库";
} else if(row.SubmitState===2) {
return "待入库";
}
else if(row.SubmitState===3)
{
return "已入库";
}
else
{
return row.SubmitStateName;
}
},
//下发维修
async addRecive(row) {
console.log(row);
if (row === 0) {
//耗材0
this.title = "维修下发(未贴标物资)";
this.addVisible = true;
this.ruleForm.BorrowList = [];
} //非耗材1
else {
this.title = "维修下发(已贴标物资)";
this.NHCaddVisible = true;
this.NHCruleForm.BorrowList = [];
}
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
});
const borrowUrl = "/api/Department/" + 0;
const { data: resdepartment } = await this.$axios.get(borrowUrl);
this.departOptions = resdepartment;
this.classOption = resclass.Rows;
},
//借出/归还
borrowOut(row, SubmitState)
{
this.editForm.ID=row.ID;
this.editForm.SubmitState=SubmitState;
var stateName="";
if(SubmitState===2)//提交
{
stateName="维修出库"
}
else if(SubmitState===3)//提交
{
stateName="维修入库"
}
else
{
stateName="撤销"
}
const url = "/api/Borrow/ChangeState" ;
this.$confirm("是否"+stateName+"该操作?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
const { data: res } = await this.$axios.post(url,this.editForm);
if (res.Success === true) {
this.getQueuData();
this.$message.success("已"+stateName);
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.error(""+stateName+"操作");
});
},
///人员选择
policeSelect(row) {
var obj = {};
obj = this.policeOptions.find(function (item) {
return item.ID === row;
});
console.log(obj)
this.ruleForm.submitUsrID =obj.ID;
this.ruleForm.submitUserName =obj.UserName;
},
///人员选择
NHCpoliceSelect(row) {
var obj = {};
// console.log("this.policeOptions",this.policeOptions)
obj = this.policeOptions.find(function (item) {
return item.ID === row;
});
this.NHCruleForm.submitUsrID = obj.ID;
this.NHCruleForm.submitUserName = obj.UserName;
console.log("obj",this.NHCruleForm)
},
///标签设置
tagSet(row) {
this.editForm.exameReason = row;
},
//获取详细列表信息
async getDetailInfo(row, type) {
if (type === 0) {
this.auditbutton = false;
} else {
this.auditbutton = true;
}
this.editForm.ID = row.ID;
console.log("type", type);
this.borrowTableVisible = true;
const borrowUrl = "/api/borrow/" + row.ID;
const { data: res } = await this.$axios.get(borrowUrl);
if (res.Success == false) return this.$message(res.Remark);
this.tableData = res.BorrowList;
this.detailData = res;
console.log("detailData", this.detailData);
},
///审核单据
async auditState(SubmitState) {
this.editForm.SubmitState = SubmitState;
this.borrowTableVisible = false;
const { data: res } = await this.$axios.post(
"/api/Borrow/ChangeState",
this.editForm
);
this.getQueuData();
if (res.Success !== true) return this.$message.error(res.Remark);
else {
return this.$message.success("审核成功");
}
},
dateChange(date) {
this.searchData.BeginTime = date ? date[0] : "";
this.searchData.EndTime = date ? date[1] : "";
// console.log("1",this.searchData.BeginTime)
// console.log("2",this.searchData.EndTime)
},
async getQueuData() {
this.loading = true;
this.searchData.borrowType = 2;
const { data: res } = await this.$axios.get("api/Borrow", {
params: this.searchData,
});
this.total = res.Total;
this.borrowData = res.Rows;
this.timer = setTimeout(() => {
//设置延迟执行
this.loading = false;
}, 300);
},
//查询条件添加回车键
onEnterPress() {
this.getQueuData();
},
// 分页功能
// 每页显示条数发生改变时
handleSizeChange(val) {
this.searchData.Rows = val;
this.getQueuData();
},
// 当前页数发生改变时
handleCurrentChange(val) {
this.searchData.Page = val;
this.getQueuData();
},
},
watch: {
activeAllData: {
handler: function (newVal, oldVal) {
this.$refs.allTableRef.setCurrentRow(this.activeAllData);
},
deep: true,
},
activeGoodData: {
handler: function (newVal, oldVal) {
this.$refs.goodsTableRef.setCurrentRow(this.activeGoodData);
},
deep: true,
},
},
computed: {},
};
</script>
<style scoped lang='less'>
body {
margin: 0;
}
.left_box,
.right_box {
height: 100%;
border-radius: 6px;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}
.dialogSize {
font-size: 15px;
}
.diaC {
font-weight: 1000;
margin-left: 12px;
margin-bottom: 12px;
}
.diaD {
margin-left: 26px;
width: 247px;
}
.labelBorrow {
// float: left;
margin: auto;
font-weight: bold;
font-size: 16px;
}
.textHeader {
background-color: #fafafa;
padding: 16px 24px;
border-right: 1px solid #e8e8e8;
text-align: center;
}
.labelClassT {
padding-left: 14px;
}
.labelClass {
font-weight: 800;
margin-left: 12px;
}
.textContent {
background-color: #ffffff;
padding: 16px 24px;
border-right: 1px solid #e8e8e8;
text-align: left;
}
.textContentLast {
background-color: #ffffff;
padding: 16px 24px;
text-align: left;
}
.buttonClass {
line-height: 0px;
text-align: center;
width: 61%;
margin-left: 29px;
height: 31px;
font-size: larger;
}
.tagel {
cursor: pointer;
margin-left: 5px;
margin-top: 5px;
margin-bottom: 5px;
}
.title_box {
margin-top: 0px;
}
.textboxBo {
margin-right: 16px;
float: left;
margin-bottom: 13px;
}
.logo {
margin-top: -4px;
margin-left: 29px;
}
</style>
......@@ -20,7 +20,7 @@
<el-breadcrumb-item :to="{ path: '/index' }"
>首页</el-breadcrumb-item
>
<el-breadcrumb-item>借领管理</el-breadcrumb-item>
<el-breadcrumb-item>业务管理</el-breadcrumb-item>
<el-breadcrumb-item>归还记录</el-breadcrumb-item>
</el-breadcrumb></el-col
>
......
......@@ -117,7 +117,7 @@ export default {
{
id: 1,
path: "/borrow",
menuName: "借领管理",
menuName: "业务管理",
icon: "资源借用",
children: [
{
......@@ -131,6 +131,12 @@ export default {
path: "/borrow/borrowGet",
menuName: "借用管理",
icon: "i_3盘盒借用",
},
{
id: 1 - 3,
path: "/borrow/repairGet",
menuName: "维修管理",
icon: "维修",
}
],
},
......@@ -186,6 +192,12 @@ export default {
icon: "储位",
},
{
id: 3 - 5,
path: "/warehouse/modularization",
menuName: "模块管理",
icon: "模块",
},
{
id: 3 - 3,
path: "/warehouse/emergencyPlan",
menuName: "预案管理",
......@@ -292,6 +304,12 @@ export default {
icon: "i_3盘盒借用",
},
{
id: 0 - 4,
path: "/systemConfig/repairApply",
menuName: "维修申请",
icon: "领用申请",
},
{
id: 0 - 3,
path: "/systemConfig/equipmentInfo",
menuName: "装备信息",
......
......@@ -144,7 +144,7 @@
>查看</a-button
>
<a-button
v-if="[-2, -1].includes(scope.row.SubmitState)"
v-if="[-2].includes(scope.row.SubmitState)"
type="primary"
class="actions"
ghost
......
<template>
<div class="body">
<!-- 面包屑导航区域 S -->
<div class="title_box">
<div class="block" style="float: left"></div>
<el-card style="height: 75px">
<el-row>
<el-col :span="2">
<img src="../../assets/images/维修.png" class="logo" alt="logo"
/></el-col>
<el-col :span="2"
><span class="fontStyle">维修申请</span><br /><span></span>
</el-col>
<el-col :span="20">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/index' }"
>首页</el-breadcrumb-item
>
<el-breadcrumb-item>系统设置 </el-breadcrumb-item>
<el-breadcrumb-item>维修申请</el-breadcrumb-item>
</el-breadcrumb></el-col
>
</el-row>
</el-card>
</div>
<!-- 主体区域 - 卡片视图 -->
<div class="main_box">
<!-- 查询功能区域 -->
<el-form
:inline="true"
:model="searchData"
size="medium"
label-position="left"
>
<el-select
class="textboxBo"
v-model="searchData.SubmitState"
filterable
clearable
placeholder="请选择状态"
>
<el-option
v-for="item in SubmitState"
:key="item.ID"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-form-item label="时间节点 :" class="mgr15 mgl15 textboxBo">
<el-date-picker
@change="dateChange"
v-model="timeData"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<a-button
type="primary"
ghost
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
>查询</a-button
>
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addHCRecive()"
>维修申请(未贴标)</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px; margin-right: 20px"
class="funcButton"
@click="addNHCRecive()"
>维修申请(已贴标)</el-button
>
</el-form>
<!-- 列表区域 -->
<el-row style="margin-top: 30px">
<!-- 主表 -->
<el-table
v-loading="loading"
:data="materielData"
stripe
style="width: 100%"
size="small"
border
highlight-current-row
>
<el-table-column
prop="IsHaoCai"
:formatter="stateFormat"
label="单据类型"
align="center"
>
</el-table-column>
<el-table-column prop="SubmitTime" label="申请时间" align="center">
</el-table-column>
<el-table-column prop="ExamineUserName" label="审核人" align="center">
</el-table-column>
<el-table-column prop="ExameReason" label="审核理由" align="center">
</el-table-column>
<el-table-column prop="ExamineTime" label="审核时间" align="center" />
<el-table-column prop="LyTime" label="维修时间" align="center">
</el-table-column>
<el-table-column prop="SubmitStateName" label="状态" align="center">
</el-table-column>
<el-table-column prop="Remarks" label="备注" align="center">
</el-table-column>
<el-table-column prop="SubmitReason" label="申请原因" align="center">
</el-table-column>
<el-table-column
label="操作"
align="left"
fixed="right"
width="240px"
prop="SubmitState"
>
<template v-slot="scope">
<a-button
type="primary"
ghost
round
size="small"
@click="getDetailInfo(scope.row)"
>查看</a-button
>
<a-button
v-if="[-2].includes(scope.row.SubmitState)"
type="primary"
class="actions"
ghost
round
size="small"
@click="edit(scope.row)"
>修改</a-button
>
<a-button
type="primary"
class="actions"
v-if="[-2].includes(scope.row.SubmitState)"
ghost
round
size="small"
@click="Submit(scope.row, 0)"
>提交</a-button
>
<a-button
type="primary"
class="actions"
v-if="scope.row.SubmitState === 0"
ghost
round
size="small"
@click="Submit(scope.row, -2)"
>撤销</a-button
>
<a-button
v-if="[-2, 0].includes(scope.row.SubmitState)"
type="primary"
ghost
round
size="small"
@click="deleteClick(scope.row)"
>删除</a-button
>
<a-button
type="primary"
class="actions"
v-if="[1].includes(scope.row.SubmitState)"
ghost
round
size="small"
@click="borrowOut(scope.row, 2)"
>已出库</a-button
>
<a-button
type="primary"
class="actions"
v-if="[2].includes(scope.row.SubmitState)"
ghost
round
size="small"
@click="borrowOut(scope.row, 3)"
>已入库</a-button
>
</template>
</el-table-column>
</el-table>
<el-dialog title="维修申请查看" :visible.sync="borrowTableVisible">
<el-card>
<div slot="header" class="clearfix" style="text-align: left">
<span class="labelBorrow">基本信息</span>
</div>
<div style="border: 1px solid #e8e8e8">
<table
size="small"
style="
table-layout: auto;
width: 100%;
border-collapse: collapse;
box-sizing: border-box;
"
>
<tbody line-height:1>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">申请原因</th>
<td class="textContent">
{{ detailData.SubmitReason }}
</td>
<th class="textHeader">申请时间</th>
<td class="textContent">
{{ detailData.SubmitTime }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">状 态</th>
<td class="textContent">
{{ detailData.SubmitStateName }}
</td>
<th class="textHeader">备 注</th>
<td class="textContent">
{{ detailData.Remarks }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">审核人</th>
<td class="textContent">
{{ detailData.ExamineUserName }}
</td>
<th class="textHeader">审核理由:</th>
<td class="textContent">
{{ detailData.ExameReason }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">审核时间</th>
<td class="textContent">
{{ detailData.ExamineTime }}
</td>
<th class="textHeader">维修时间</th>
<td class="textContent">
{{ detailData.LyTime }}
</td>
</tr>
</tbody>
</table>
</div>
</el-card>
<el-card
v-if="HCShow"
class="box-card"
style="text-align: center; margin-top: 35px"
>
<label class="labelBorrow">维修装备表(未贴标)</label>
<el-divider></el-divider>
<template>
<el-table :data="HctableData" border class="details">
<el-table-column
prop="MaterielName"
label="装备大类"
align="center"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="装备物料"
align="center"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="装备名称"
align="center"
>
</el-table-column>
<el-table-column
prop="EqSizeName"
label="装备号型"
align="center"
>
</el-table-column>
</el-table>
</template>
</el-card>
<el-card
v-if="NHCShow"
class="box-card"
style="text-align: center; margin-top: 35px"
>
<label class="labelBorrow">维修装备表(已贴标)</label>
<el-divider></el-divider>
<template>
<el-table :data="NHctableData" border class="details">
<el-table-column
prop="MaterielName"
label="物料名称"
align="center"
>
</el-table-column>
<el-table-column
prop="NameAndCode"
label="装备名称"
align="center"
>
</el-table-column>
<el-table-column
prop="EqSizeName"
label="号型名称"
align="center"
>
</el-table-column>
<el-table-column
prop="OutTime"
label="出库时间"
align="center"
>
</el-table-column>
<el-table-column
prop="ReturnTime"
label="入库时间"
align="center"
>
</el-table-column>
</el-table>
</template>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="borrowTableVisible = false">取 消</el-button>
<el-button type="primary" @click="borrowTableVisible = false"
>确 定</el-button
>
</div>
</el-dialog>
<!-- 新增/编辑 非耗材-->
<el-dialog
width="70%"
:close-on-click-modal="false"
:title="title"
:visible.sync="addVisible"
@close="closeForm('ruleForm')"
>
<div style="border: 0px solid #e8e8e8">
<el-divider></el-divider>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
style="margin-top: 10px; margin-bottom: 35px"
>
<el-row :gutter="10">
<el-col :span="8" class="dia">
<el-form class="diaC">大类选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MainClass"
filterable
clearable
style="width: 300px"
@change="getClass($event, 'nhc')"
placeholder="请选择大类"
>
<el-option
v-for="item in classOption"
:key="item.ID"
:label="item.EqCategoryName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">物料选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MaterielName"
filterable
clearable
style="width: 300px"
@change="getMateriel"
placeholder="请选择物料"
>
<el-option
v-for="item in MaterielOption"
:key="item.ID"
:label="item.MaterielName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">号型选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.EqSizeId"
filterable
clearable
style="width: 300px"
@change="getIDAndName"
placeholder="请选择号型"
>
<el-option
v-for="item in sizeOption"
:key="item.ID"
:label="item.EqSizeName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">装备选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.EquipmentId"
filterable
clearable
style="width: 300px"
@change="getEquipment"
placeholder="请选择具体装备"
>
<el-option
v-for="item in eqOption"
:key="item.ID"
:label="item.NameAndCode"
:value="item.ID"
>
</el-option>
</el-select>
<el-button
size="small"
class="buttonClass"
type="primary"
icon="el-icon-circle-plus-outline"
round
@click="addEquipment"
>添加装备</el-button
>
</el-col>
<el-col :span="16" style="padding-top: 31px">
<el-table
:data="ruleForm.BorrowList"
ref="BorrowList"
height="250"
border
style="width: 100%"
>
<el-table-column
prop="MaterielID"
label="物料ID"
align="center"
v-if="false"
>
</el-table-column>
<el-table-column
prop="EqSizeName"
label="号型名称"
align="center"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="物料名称"
align="center"
>
</el-table-column>
<el-table-column
prop="NameAndCode"
label="装备名称"
align="center"
>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="deleteEquipment(scope.$index, scope.row)"
icon="el-icon-delete"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="10"> </el-col>
</el-row>
</el-form>
<el-divider></el-divider>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
style="margin-top: 10px"
>
<!-- class="inputClass" -->
<el-row :gutter="90" style="margin-top: 30px">
<el-col :span="6">
<el-form-item label="申请原因" class="labelClass">
<el-input
class="labelClassT"
type="textarea"
:rows="2"
v-model="ruleForm.SubmitReason"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="备注" class="labelClass">
<el-input
class="labelClassT"
type="textarea"
:rows="2"
v-model="ruleForm.Remarks"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm('ruleForm', title)"
>提交</el-button
>
</span>
</el-dialog>
<!-- 新增/编辑 耗材-->
<el-dialog
width="70%"
:close-on-click-modal="false"
:title="title"
:visible.sync="HCVisible"
@close="closeForm()"
>
<div style="border: 0px solid #e8e8e8">
<el-divider></el-divider>
<el-form
:model="HCruleForm"
:rules="rules"
ref="HCruleForm"
label-width="100px"
style="margin-top: 10px; margin-bottom: 35px"
>
<el-row :gutter="10">
<el-col :span="8" class="dia">
<el-form class="diaC">大类选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MainClass"
filterable
clearable
style="width: 300px"
@change="getClass($event, 'hc')"
placeholder="请选择大类"
>
<el-option
v-for="item in classOption"
:key="item.ID"
:label="item.EqCategoryName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">物料选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MaterielName"
filterable
clearable
style="width: 300px"
@change="getMateriel"
placeholder="请选择物料"
>
<el-option
v-for="item in MaterielOption"
:key="item.ID"
:label="item.MaterielName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">号型选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.EqSizeId"
filterable
clearable
style="width: 300px"
@change="getIDAndName"
placeholder="请选择号型"
>
<el-option
v-for="item in sizeOption"
:key="item.ID"
:label="item.EqSizeName"
:value="item.ID"
>
</el-option>
</el-select>
<el-button
size="small"
class="buttonClass"
type="primary"
icon="el-icon-circle-plus-outline"
round
@click="addHCEquipment"
>添加装备</el-button
>
</el-col>
<el-col :span="16" style="padding-top: 31px">
<el-table
:data="HCruleForm.BorrowList"
ref="BorrowList"
height="250"
border
style="width: 100%"
>
<el-table-column
prop="MaterielID"
label="物料ID"
align="center"
v-if="false"
>
</el-table-column>
<el-table-column
prop="EqSizeName"
label="号型名称"
align="center"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="物料名称"
align="center"
>
</el-table-column>
<el-table-column
prop="LyCount"
label="装备数量"
align="center"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.LyCount"
:min="1"
:max="200"
></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="deleteHCEquipment(scope.$index, scope.row)"
icon="el-icon-delete"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="10"> </el-col>
</el-row>
</el-form>
<el-divider></el-divider>
<el-form
:model="HCruleForm"
:rules="rules"
ref="HCruleForm"
label-width="100px"
style="margin-top: 10px"
>
<!-- class="inputClass" -->
<el-row :gutter="90" style="margin-top: 30px">
<el-col :span="6">
<el-form-item label="申请原因" class="labelClass">
<el-input
class="labelClassT"
type="textarea"
:rows="2"
v-model="HCruleForm.SubmitReason"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" class="labelClass">
<el-input
class="labelClassT"
type="textarea"
:rows="2"
v-model="HCruleForm.Remarks"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="HCVisible = false">取 消</el-button>
<el-button type="primary" @click="HcsubmitForm('HCruleForm', title)"
>提交</el-button
>
</span>
</el-dialog>
<!-- 分页功能 -->
<el-row type="flex" justify="center" align="middle">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchData.page"
:page-sizes="[10, 20, 30, 40]"
:page-size="searchData.size"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
/>
</el-row>
</el-row>
</div>
</div>
</template>
<script>
import { quillEditor, Quill } from "vue-quill-editor";
// import { quillEditor } from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
const Font = Quill.import("attributors/style/font"); // 引入这个后会把样式写在style上
const fonts = ["SimSun", "SimHei", "Microsoft-YaHei", "KaiTi", "FangSong"];
import { mapState } from "vuex";
export default {
components: { quillEditor },
data() {
return {
SubmitState: [
{
value: "-3",
label: "全部",
},
{
value: "-2",
label: "待提交",
},
{
value: "-1",
label: "未通过",
},
{
value: "0",
label: "待审批",
},
{
value: "1",
label: "待出库",
},
{
value: "2",
label: "已出库",
},
{
value: "3",
label: "已入库",
},
],
HCVisible: false,
// 用户选中日期
timeData: [],
// 日期配置
pickerOptions: {
shortcuts: [
{
text: "最近一日",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
HCShow: false,
NHCShow: false,
searchData: {
Page: 1,
Rows: 10,
Sort: "ID",
Order: "ESC",
SubmitState: "", //审核状态
SubmitUsrID: "", //登录账号ID
BeginTime: "",
EndTime: "",
BorrowType: 2,
},
searchEqCategoryData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
},
searchClassData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ESC",
CategoryID: "",
IsHaoCai: 0,
},
searchEquipmentData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ESC",
MaterielId: "",
EqSizeId: "",
State: 0,
IsNoBorrow: true
},
classOption: [],
MaterielOption: [],
sizeOption: [],
eqOption: [],
ruleForm: {
IsHaoCai: 1,
ID: 0,
PlanName: "",
PlanState: 0,
borrowType: 2,
epc: "",
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielID: "",
EqSizeId: "",
EqSizeName: "",
EquipmentId: "",
LyCount: 1,
EquipmentId: "",
NameAndCode: "",
},
],
},
HCruleForm: {
IsHaoCai: 1,
borrowType: 2,
ID: 0,
PlanName: "",
PlanState: 0,
LabelEpc: "",
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielID: "",
EqSizeId: "",
EqSizeName: "",
EquipmentId: "",
LyCount: 1,
EquipmentId: "",
NameAndCode: "",
},
],
},
AddPlanForm: {
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
NameAndCode: "",
epc: "",
EquipmentId: "",
State:0,
},
resetForm() {
(this.eqOption = []),
(this.classOption = []),
(this.MaterielOption = []),
(this.sizeOption = []),
(this.AddPlanForm = {
MaterielName: "",
MainClass: "",
MaterielCode: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EqSizeCode: "",
EquipmentId: "",
}),
(this.ruleForm = {
ID: 0,
SubmitReason: "", //申请理由
Remarks: "", //备注
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielID: "",
EqSizeId: "",
EqSizeName: "",
EqSizeCode: "",
LyCount: 1,
EquipmentId: "",
NameAndCode: "",
},
],
});
this.HCruleForm = {
ID: 0,
SubmitReason: "", //申请理由
Remarks: "", //备注
IsHaoCai: 1,
borrowType: 2,
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielID: "",
EqSizeId: "",
EqSizeName: "",
EqSizeCode: "",
LyCount: 1,
EquipmentId: "",
NameAndCode: "",
},
],
};
},
borrowGet:"",
title: "",
fixData: {
Page: 1,
Rows: 10,
MatId: "",
Order: "ESC",
Sort: "ID",
},
editForm: {
ID: "",
SubmitState: 0,
},
addVisible: false,
borrowTableVisible: false,
detailData: {},
fixdetailData: [],
loading: false,
tabLoading: false,
src: "../assets/images/记录.png",
activeName: "first",
rules: {
CategoryID: [
{ required: true, message: "请选择物料类型", trigger: "change" },
],
Code: [
{
required: true,
message: "请输入编码",
trigger: "blur",
},
{ min: 1, message: "请输入编码", trigger: "blur" },
],
MaterielName: [
{
required: true,
message: "请输入物料名称",
trigger: "blur",
},
{ min: 1, message: "请输入物料名称", trigger: "blur" },
],
Unit: [
{
required: true,
message: "请输入物料单位",
trigger: "blur",
},
{ min: 1, message: "请输入物料单位", trigger: "blur" },
],
},
searchMaterielData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ESC",
MaterielId: "",
},
EditRuleForm: {
ID: "",
CategoryName: "",
TermDays: 0,
Code: "",
PlanName: "",
MaterielName: "",
Unit: "",
CategoryID: "",
EqCount: "",
IsHaoCai: 1,
Storage: "",
Instructions: "",
WeiXiuCL: "",
BaoYangCL: "",
Remarks: "",
},
materielData: [],
HctableData: [],
NHctableData: [],
formLabelWidth: "120px",
history_Num: "",
// 总条数
total: 0,
};
},
computed: {
// vuex数据
...mapState(["userData"]),
},
created() {
this.getQueuData();
},
methods: {
dateChange(date) {
this.searchData.BeginTime = date ? date[0] : "";
this.searchData.EndTime = date ? date[1] : "";
// console.log("1",this.searchData.BeginTime)
// console.log("2",this.searchData.EndTime)
},
handleClick(tab, event) {
this.tabLoading = true;
console.log("300");
this.timer = setTimeout(() => {
//设置延迟执行
console.log("400");
this.tabLoading = false;
}, 2000);
},
//查看信息
check(row) {
this.borrowTableVisible = true;
this.detailData = row;
},
//新增耗材申请
async addHCRecive() {
this.title = "维修申请(未贴标)";
this.HCVisible = true;
this.HCruleForm.BorrowList = [];
// console.log("rule",this.ruleForm)
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
});
this.classOption = resclass.Rows;
},
//新增维修申请
async addNHCRecive() {
this.title = "维修申请(已贴标)";
this.addVisible = true;
this.ruleForm.BorrowList = [];
// console.log("rule",this.ruleForm)
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
});
this.classOption = resclass.Rows;
},
//编辑信息
async edit(row) {
console.log(row);
if (row.IsHaoCai === 0) {
//非耗材
this.addVisible = true;
this.title = "修改维修申请(已贴标)";
this.addVisible = true;
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
this.ruleForm = JSON.parse(JSON.stringify(res));
// console.log("rule",this.ruleForm)
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
});
this.classOption = resclass.Rows;
} else {
//耗材
this.title = "修改维修申请(未贴标)";
this.HCVisible = true;
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
this.HCruleForm = JSON.parse(JSON.stringify(res));
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
});
this.classOption = resclass.Rows;
}
},
//获取号型
async getMateriel(val) {
this.sizeOption = [];
this.eqOption = [];
this.AddPlanForm.EquipmentId = "";
this.AddPlanForm.NameAndCode = "";
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
this.searchMaterielData.MaterielId = val;
if (val !== "") {
var obj = {};
obj = this.MaterielOption.find(function (item) {
return item.ID === val;
});
this.AddPlanForm.MaterielId = obj.ID;
this.AddPlanForm.MaterielCode = obj.MaterielCode;
this.AddPlanForm.MaterielName = obj.MaterielName;
this.searchEquipmentData.MaterielId = obj.ID;
const { data: res } = await this.$axios.get("api/EqSize", {
params: this.searchMaterielData,
});
const { data: eqres } = await this.$axios.get("api/Equipment", {
params: this.searchEquipmentData,
});
this.sizeOption = res.Rows;
this.eqOption = eqres.Rows;
// console.log("size",this.sizeOption)
} else {
this.MaterielOption = [];
this.eqOption = [];
this.sizeOption = [];
this.AddPlanForm.MaterielID = "";
this.AddPlanForm.MaterielName = "";
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
this.AddPlanForm.EquipmentId = "";
this.AddPlanForm.NameAndCode = "";
}
},
//获取装备
async getEquipment(val) {
console.log(val)
if (val !== "") {
var obj = {};
obj = this.eqOption.find(function (item) {
return item.ID === val;
});
this.AddPlanForm.EquipmentId = obj.ID;
this.AddPlanForm.NameAndCode = obj.NameAndCode;
this.AddPlanForm.epc = obj.LabelEpc;
}
},
//获取号型的名字和ID
async getIDAndName(val) {
if (val !== "") {
var obj = {};
obj = this.sizeOption.find(function (item) {
return item.ID === val;
});
this.searchEquipmentData.EqSizeId = obj.ID;
const { data: eqres } = await this.$axios.get("api/Equipment", {
params: this.searchEquipmentData,
});
this.eqOption = eqres.Rows;
// console.log(obj)
this.AddPlanForm.EqSizeId = obj.ID;
this.AddPlanForm.EqSizeName = obj.EqSizeName;
this.AddPlanForm.EqSizeCode = obj.Code;
} else {
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
this.searchEquipmentData.EqSizeId = "";
this.searchEquipmentData.EqSizeName = "";
const { data: eqres } = await this.$axios.get("api/Equipment", {
params: this.searchEquipmentData,
});
this.eqOption = eqres.Rows;
}
},
//获取详细信息
async getDetailInfo(row) {
this.borrowTableVisible = true;
const borrowUrl = "/api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(borrowUrl);
if (res.Success == false) return this.$message(res.Remark);
if (res.IsHaoCai == 1) {
//耗材
this.HctableData = res.BorrowList;
this.detailData = res;
this.HCShow = true;
this.NHCShow = false;
} //非耗材
else {
this.HCShow = false;
this.NHCShow = true;
console.log("Nohaocai", res);
this.NHctableData = res.BorrowList;
this.detailData = res;
}
},
async submitData(row) {
console.log("提交信息", row);
const formData = new FormData();
formData.append("ID", this.row.ID);
formData.append("DepartName", this.row.DepartName);
formData.append("UserID", this.row.UserID);
formData.append("UserName", this.row.UserName);
formData.append("State", this.row.State);
formData.append("Remarks", this.row.Remarks);
formData.append("LyTime", this.row.LyTime);
formData.append("SubmitState", this.row.SubmitState);
formData.append("SubmitStateName", this.row.SubmitStateName);
formData.append("SubmitUsrID", this.row.SubmitUsrID);
formData.append("SubmitUserName", this.row.SubmitUserName);
formData.append("SubmitTime", this.row.SubmitTime);
formData.append("ExamineState", this.row.ExamineState);
formData.append("ExamineStateName", this.row.ExamineStateName);
formData.append("ExamineUserID", this.row.ExamineUserID);
formData.append("ExamineUserName", this.row.ExamineUserName);
formData.append("ExamineTime", this.row.ExamineTime);
formData.append("SubmitReason", this.row.SubmitReason);
formData.append("ExameReason", this.row.ExameReason);
formData.append("CreateTime", this.row.CreateTime);
console.log("formData", formData);
const config = {
headers: {
"Content-Type": "multipart/form-data",
},
};
// console.log(this.ruleForm.ID)
const { data: res } = await this.$axios.put(
"/api/Borrow",
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
this.getQueuData();
},
///获取类别的ID和内容
///获取物料内容
async getClass(val, b) {
if (b === "hc") {
//耗材
this.searchClassData.IsHaoCai = 1;
} //非耗材
else {
this.searchClassData.IsHaoCai = 0;
}
this.AddPlanForm.MaterielName = "";
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EquipmentId = "";
this.AddPlanForm.NameAndCode = "";
if (val !== "") {
this.searchClassData.CategoryID = val;
const { data: res } = await this.$axios.get("api/Materiel", {
params: this.searchClassData,
});
this.MaterielOption = res.Rows;
} else {
this.eqOption = [];
this.sizeOption = [];
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
this.AddPlanForm.EquipmentId = "";
this.AddPlanForm.NameAndCode = "";
}
},
//添加耗材装备
addHCEquipment() {
console.log(this.AddPlanForm)
if (this.AddPlanForm.MaterielId === "") {
this.$message.warning("请选择物料");
return;
}
var obj = {};
var plan = {
LyCount: 1,
MainClass: this.AddPlanForm.MainClass,
MaterielName: this.AddPlanForm.MaterielName,
MaterielID: this.AddPlanForm.MaterielId,
MaterielCode: this.AddPlanForm.MaterielCode,
EqSizeId: this.AddPlanForm.EqSizeId,
EqSizeName: this.AddPlanForm.EqSizeName,
EqSizeCode: this.AddPlanForm.EqSizeCode,
};
obj = this.HCruleForm.BorrowList.find(function (item) {
return (
item.EqSizeId === plan.EqSizeId &&
item.MaterielCode === plan.MaterielCode
);
});
console.log("obj", obj);
if (obj === undefined) {
this.HCruleForm.BorrowList.push(plan);
} else {
this.$message.error("已经存在该物资");
}
},
//添加非耗材装备
addEquipment() {
if (this.AddPlanForm.EquipmentId === "") {
this.$message.warning("请选择物资");
return;
}
var obj = {};
var plan = {
LyCount: 1,
MainClass: this.AddPlanForm.MainClass,
MaterielName: this.AddPlanForm.MaterielName,
MaterielID: this.AddPlanForm.MaterielId,
MaterielCode: this.AddPlanForm.MaterielCode,
EqSizeId: this.AddPlanForm.EqSizeId,
EqSizeName: this.AddPlanForm.EqSizeName,
EqSizeCode: this.AddPlanForm.EqSizeCode,
NameAndCode: this.AddPlanForm.NameAndCode,
EquipmentId: this.AddPlanForm.EquipmentId,
epc: this.AddPlanForm.epc,
};
console.log("添加物资", plan);
obj = this.ruleForm.BorrowList.find(function (item) {
return item.EquipmentId === plan.EquipmentId;
});
if (obj === undefined) {
this.ruleForm.BorrowList.push(plan);
} else {
this.$message.error("已经存在该物资");
}
},
//删除装备
deleteEquipment(row) {
this.ruleForm.BorrowList.splice(row, 1);
},
deleteHCEquipment(row) {
this.HCruleForm.BorrowList.splice(row, 1);
},
// 提交操作
Submit(row, SubmitState) {
this.editForm.ID = row.ID;
this.editForm.SubmitState = SubmitState;
var stateName = "";
if (SubmitState === 0) {
//提交
stateName = "提交";
} else {
stateName = "撤销";
}
const url = "/api/Borrow/ChangeState";
this.$confirm("是否" + stateName + "提交该数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
const { data: res } = await this.$axios.post(url, this.editForm);
if (res.Success === true) {
this.getQueuData();
this.$message.success("已" + stateName + "该申请");
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.error("" + stateName + "申请");
});
},
// 领取操作
receive(row) {
this.$confirm("是否执行领取操作?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
// this.submitData(row);
console.log("提交信息", row);
const formData = new FormData();
formData.append("ID", row.ID);
formData.append("DepartName", row.DepartName);
formData.append("UserID", row.UserID);
formData.append("UserName", row.UserName);
formData.append("LyTime", row.LyTime);
formData.append("Remarks", row.Remarks);
formData.append("SubmitState", 2);
formData.append("SubmitStateName", row.SubmitStateName);
formData.append("SubmitUsrID", row.SubmitUsrID);
formData.append("SubmitTime", row.SubmitTime);
formData.append("ExamineState", row.ExamineState);
formData.append("ExamineStateName", row.ExamineStateName);
formData.append("ExamineUserID", row.ExamineUserID);
formData.append("ExamineTime", row.ExamineTime);
formData.append("CreateTime", row.CreateTime);
console.log("formData", formData);
const config = {
headers: {
"Content-Type": "multipart/form-data",
},
};
// console.log(this.ruleForm.ID)
const { data: res } = await this.$axios.put(
"/api/Borrow",
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
this.getQueuData();
})
.catch((e) => {
this.$message.error("已取消领取");
});
},
//耗材提交数据
HcsubmitForm(formName, type) {
// console.log("HC",this.HCruleForm);
if (this.HCruleForm.BorrowList.length === 0) {
return this.$message.warning("请添加装备");
}
var IsAdmin = false;
if ((this.userData.State = 1)) {
this.IsAdmin = true;
}
const borrowUrl = "/api/Borrow?" + "IsAdmin=" + IsAdmin;
this.$refs[formName].validate(async (valid) => {
if (valid) {
if (type === "维修申请(未贴标)") {
const { data: res } = await this.$axios.post(
borrowUrl,
this.HCruleForm
);
if (res.Success !== true) return this.$message(res.message);
} else {
const { data: res } = await this.$axios.put(
borrowUrl,
this.HCruleForm
);
if (res.Success !== true) return this.$message(res.message);
}
this.getQueuData();
this.HCVisible = false;
} else {
return false;
}
});
},
///提交非耗材表单
submitForm(formName, type) {
console.log("sub", this.ruleForm);
if (this.ruleForm.BorrowList.length === 0) {
return this.$message.warning("请添加装备");
}
this.ruleForm.borrowType = 2;
this.ruleForm.IsHaoCai = 0;
var IsAdmin = false;
if ((this.userData.State = 1)) {
this.IsAdmin = true;
}
const borrowUrl = "/api/Borrow?" + "IsAdmin=" + IsAdmin;
this.$refs[formName].validate(async (valid) => {
if (valid) {
if (type === "维修申请(已贴标)") {
const { data: res } = await this.$axios.post(
borrowUrl,
this.ruleForm
);
if (res.Success !== true) return this.$message(res.message);
} else {
//修改预案类型
const { data: res } = await this.$axios.put(
borrowUrl,
this.ruleForm
);
if (res.Success !== true) return this.$message(res.message);
}
this.getQueuData();
this.addVisible = false;
} else {
return false;
}
});
},
async getQueuData() {
this.loading = true;
this.searchData.SubmitUsrID = this.userData.Id;
const { data: res } = await this.$axios.get("api/Borrow", {
params: this.searchData,
});
this.total = res.Total;
this.materielData = res.Rows;
this.timer = setTimeout(() => {
//设置延迟执行
this.loading = false;
}, 300);
},
//查询条件添加回车键
onEnterPress() {
this.getQueuData();
},
// 删除
deleteClick(row) {
const url = "/api/Borrow/" + row.ID;
this.$confirm("此操作将永久删除该条数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
const { data: res } = await this.$axios.delete(url);
if (res.Success === true) {
this.getQueuData();
this.$message.success(res.Remark);
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.error("已取消删除");
});
},
//借出/归还
borrowOut(row, SubmitState)
{
this.editForm.ID=row.ID;
this.editForm.SubmitState=SubmitState;
var stateName="";
if(SubmitState===2)//提交
{
stateName="维修出库"
}
else if(SubmitState===3)//提交
{
stateName="维修入库"
}
else
{
stateName="撤销"
}
const url = "/api/Borrow/ChangeState" ;
this.$confirm("是否"+stateName+"该操作?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
const { data: res } = await this.$axios.post(url,this.editForm);
if (res.Success === true) {
this.getQueuData();
this.$message.success("已"+stateName);
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.error(""+stateName+"操作");
});
},
// 分页功能
// 每页显示条数发生改变时
handleSizeChange(val) {
this.searchData.Rows = val;
this.getQueuData();
},
// 当前页数发生改变时
handleCurrentChange(val) {
this.searchData.Page = val;
console.log(val);
this.getQueuData();
},
stateFormat(row) {
if (row.IsHaoCai === 0) {
return "已贴标";
} else if (row.IsHaoCai === 1) {
return "未贴标";
} else {
return "";
}
},
closeForm() {
this.resetForm();
},
},
};
</script>
<style scoped lang="less">
body {
margin: 0;
}
.dialogSize {
font-size: 15px;
}
.labelClassT {
width: 282px;
}
.labelClass {
font-weight: 800;
}
.labelBorrow {
margin: auto;
font-weight: bold;
font-size: 16px;
}
.diaB {
font-weight: 1000;
margin-left: 29px;
margin-top: 10px;
}
.inputA {
width: 182px;
}
.textHeader {
background-color: #fafafa;
padding: 16px 24px;
border-right: 1px solid #e8e8e8;
text-align: center;
width: 110px;
}
.textContent {
background-color: #ffffff;
padding: 16px 24px;
border-right: 1px solid #e8e8e8;
text-align: left;
}
.textContentLast {
background-color: #ffffff;
padding: 16px 24px;
text-align: left;
}
.title_box {
margin-top: 0px;
}
.myQuillEditor {
width: 450px;
min-height: 192px;
}
.diaC {
font-weight: 1000;
margin-left: 29px;
margin-bottom: 6px;
}
.textboxBo {
margin-right: 16px;
float: left;
margin-bottom: 13px;
}
.areaClass {
width: 87%;
}
.logo {
margin-top: -4px;
margin-left: 29px;
}
.el-dialog {
width: 66%;
}
.buttonClass {
line-height: 0px;
text-align: center;
margin-top: 12px;
width: 61%;
margin-left: 29px;
height: 31px;
font-size: larger;
}
</style>
......@@ -45,12 +45,12 @@
</el-col>
<el-col :span="6">
<el-form-item label="储位:">
<span class="clock_text">{{borrowData[0].StorageCode===""?"暂无":borrowData[0].StorageCode}}</span>
<span class="clock_text">{{borrowData.StorageCode===""?"暂无":borrowData.StorageCode}}</span>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="部门:">
<span class="clock_text">{{borrowData[0].DepartName===""?"暂无":borrowData[0].DepartName}}</span>
<span class="clock_text">{{borrowData.DepartName===""?"暂无":borrowData.DepartName}}</span>
</el-form-item>
</el-col>
</el-row>
......@@ -361,6 +361,7 @@ export default {
form: {},
tableData: [],
borrowData: [],
StorageCode:'',
cabinetShow:true,
editData: [],
addVisible: false,
......
......@@ -78,7 +78,7 @@
style="height: 40px"
class="funcButton"
@click="addWarehouse()"
>新增</el-button
>添加储位</el-button
>
</el-form>
......
......@@ -119,7 +119,7 @@
@click="watch(scope.row)"
>查看</a-button
>
<a-button
<!-- <a-button
type="primary"
class="actions"
ghost
......@@ -127,7 +127,7 @@
size="small"
@click="edit(scope.row)"
>修改</a-button
>
> -->
<a-button
type="primary"
class="actions"
......@@ -213,7 +213,7 @@
</el-form>
<el-divider></el-divider>
<el-form
<!-- <el-form
:model="ruleForm"
:rules="rules"
ref="ruleSet2"
......@@ -342,6 +342,202 @@
</el-col>
<el-col :span="10"> </el-col>
</el-row>
</el-form> -->
<!-- 选择添加装备模块 -->
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleSet2"
label-width="100px"
style="margin-top: 10px"
>
<el-row :gutter="10" style="height: 250px;">
<el-col :span="8" class="dia">
<el-select
class="diaC"
v-model="EquipmentId"
filterable
clearable
style="width: 260px"
placeholder="请选择装备模块"
@change="changeAddPlanForm"
>
<el-option
v-for="item in PlanModelOption"
:key="item.ID"
:label="item.PlanModelName"
:value="item.ID"
>
</el-option>
</el-select>
<el-button
size="small"
class="buttonClass"
type="primary"
icon="el-icon-circle-plus-outline"
round
@click="addPlanModelEquipment"
>添加模块</el-button
>
</el-col>
<el-col :span="15" >
<el-table
:data="ruleForm.PlanModel"
ref="PlanModel"
max-height="180"
border
style="width: 100%"
>
<el-table-column
prop="ID"
label="模块ID"
align="center"
v-if="false"
>
</el-table-column>
<el-table-column
prop="PlanModelName"
label="模块名称"
align="center"
>
</el-table-column>
<el-table-column
prop="PlanModelInfo"
label="模块信息"
align="center"
>
</el-table-column>
<el-table-column
prop="Remark"
label="备注"
align="center"
>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="deletePlanModel(scope.$index, scope.row)"
icon="el-icon-delete"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="10"> </el-col>
</el-row>
</el-form>
<el-divider ></el-divider>
<!-- 选择添加警员 -->
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleSet2"
label-width="100px"
style="margin-top: 20px"
>
<el-row :gutter="10">
<el-col :span="8" class="dia">
<el-select
class="diaC"
v-model="PoliceTypId"
filterable
clearable
style="width: 260px"
@change="getPoliceTyp"
placeholder="请选择警种"
>
<el-option
v-for="item in classOption"
:key="item.ID"
:label="item.CategoryName"
:value="item.ID"
>
</el-option>
</el-select>
<el-select
class="diaC"
v-model="UserId"
filterable
clearable
style="width: 260px"
placeholder="请选择警员"
@change="changeAddPoliceCategoryForm"
>
<el-option
v-for="item in PoliceOption"
:key="item.ID"
:label="item.UserName"
:value="item.ID"
>
</el-option>
</el-select>
<el-button
size="small"
class="buttonClass"
type="primary"
icon="el-icon-circle-plus-outline"
round
@click="addPoliceCategory"
>添加警员</el-button
>
</el-col>
<el-col :span="15" >
<el-table
:data="ruleForm.PlanPolice"
ref="PlanPolice"
max-height="180"
border
style="width: 100%"
>
<el-table-column
prop="ID"
label="警员ID"
align="center"
v-if="false"
>
</el-table-column>
<el-table-column
prop="UserName"
label="警员"
align="center"
>
</el-table-column>
<el-table-column
prop="PoliceCategoryldName"
label="警种名称"
align="center"
>
</el-table-column>
<el-table-column
prop="PoliceTypeName"
label="警员类型"
align="center"
>
</el-table-column>
<el-table-column
prop="DepartName"
label="部门"
align="center"
>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="deletePlanPolice(scope.$index, scope.row)"
icon="el-icon-delete"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="10"> </el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
......@@ -354,7 +550,7 @@
<!-- 详细信息弹出 -->
<el-dialog title="查看明细" :visible.sync="baseTableVisible">
<el-card>
<el-card >
<div slot="header" class="clearfix">
<span class="labelBorrow">基础信息</span>
</div>
......@@ -367,7 +563,7 @@
box-sizing: border-box;
"
>
<tbody>
<tbody height="180px">
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">预案名称</th>
<td class="textContent">
......@@ -390,26 +586,40 @@
{{ detailData.PlanInfo }}
</td>
</tr>
<tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">备注</th>
<td colspan="5" class="textContentLast">
{{ detailData.Remark }}
</td>
</tr>
</tbody>
</table>
</div>
</el-card>
<el-card class="box-card" style="margin-top: 35px">
<el-card class="box-card" style="margin-top: 5px">
<label class="labelBorrow">相关人员明细表</label>
<el-divider></el-divider>
<template>
<el-table :data="tablePoliceData" border class="details" max-height="150">
<el-table-column prop="UserName" label="相关人员" align="center">
</el-table-column>
<el-table-column prop="PoliceCategoryldName" label="所属警种" align="center">
</el-table-column>
</el-table>
</template>
</el-card>
<el-card class="box-card" style="margin-top: 5px">
<label class="labelBorrow">装备明细表</label>
<el-divider></el-divider>
<template>
<el-table :data="tableData" border class="details">
<el-table-column prop="EqSizeName" label="号型名称">
<el-table :data="tableData" border class="details" max-height="180">
<el-table-column prop="EqSizeName" label="号型名称" align="center">
</el-table-column>
<el-table-column prop="MaterielName" label="物料名称">
<el-table-column prop="MaterielName" label="物料名称" align="center">
</el-table-column>
<el-table-column prop="EqCount" label="装备数量">
<el-table-column prop="EqCount" label="装备数量" align="center">
</el-table-column>
</el-table>
</template>
......@@ -444,6 +654,10 @@
export default {
data() {
return {
UserName:"",
PoliceTypId: '',
UserId: '',
EquipmentId: '',
rules: {
PlanName: [
{ required: true, message: "请输入预案名称", trigger: "blur" },
......@@ -452,9 +666,13 @@ export default {
},
baseTableVisible: false,
tableData: [],
tablePoliceData:[],
classOption: [],
PlanModelOption:[],
PoliceOption:[],
MaterielOption: [],
sizeOption: [],
PlanModel:[],
searchData: {
Page: 1,
Rows: 10,
......@@ -468,22 +686,12 @@ export default {
Sort: "ID",
Order: "ASC",
},
resetForm() {
this.$refs["ruleSet"].resetFields();
this.AddPlanForm={
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
}
},
searchClassData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
CategoryID: "",
PoliceCategoryId: "",
},
searchMaterielData: {
Page: 1,
......@@ -499,6 +707,8 @@ export default {
PlanState: 0,
PlanDetail: [
{
ID:"",
planId:"",
MainClass: "",
Materiel: "",
MaterielId: "",
......@@ -507,13 +717,63 @@ export default {
EqCount: 1,
},
],
//警员
PlanPolice: [
{
ID: 0,
planId: 0,
userId: 0,
userName: "",
policeCategoryId: 0,
policeCategoryldName: "",
},
],
},
//模块
PlanModel:[
{
ID:0,
PlanModelName:"",
Remark:"",
PlanModelInfo:"",
PlanModelDetail:[{
EqCount: 1,
EqSizeId: "",
EqSizeName: "",
ID: 0,
MaterielId: "",
MaterielName: "",
PlanModelId: "",
}]
}
],
AddPlanPoliceForm: {
ID: "",
UserName:"",
PoliceCategoryId: "",
DepartName:"",
PoliceTypeName:"",
},
AddPlanForm: {
ID: "",
PlanModelName:"",
PlanModelInfo:"",
Remark: "",
PlanDetail:[],
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
UserName:"",
PoliceCategoryId: "",
DepartName:"",
PoliceTypeName:"",
PoliceCategoryldName:"",
},
AddPoliceForm: {
},
detailData: [],
......@@ -557,22 +817,29 @@ export default {
const borrowUrl = "/api/Plan/" + row.ID;
const { data: res } = await this.$axios.get(borrowUrl);
if (res.Success == false) return this.$message(res.Remark);
this.tablePoliceData = res.PlanPolice;
this.tableData = res.PlanDetail;
this.detailData = res;
},
//提交表单
submitForm(type) {
console.log("RU", this.ruleForm);
// console.log("RU", this.ruleForm);
// console.log(this.ruleForm.PlanDetail);
this.$refs["ruleSet"].validate(async (valid) => {
if (valid) {
if (type === "添加预案") {
this.ruleForm.PlanModel.forEach(element => {
element.PlanDetail.forEach(x => {
this.ruleForm.PlanDetail.push(x)
})
});
console.log(this.ruleForm.PlanDetail)
if (
this.ruleForm.PlanDetail == undefined ||
this.ruleForm.PlanDetail.length <= 0
) {
return this.$message.error("请至少添加一个物资");
return this.$message.error("请至少添加一个模块");
}
const { data: res } = await this.$axios.post(
"/api/Plan",
......@@ -584,7 +851,7 @@ export default {
this.ruleForm.PlanDetail == undefined ||
this.ruleForm.PlanDetail.length <= 0
) {
return this.$message.error("请至少添加一个物资");
return this.$message.error("请至少添加一个模块");
}
//修改预案类型
const { data: res } = await this.$axios.put(
......@@ -659,6 +926,17 @@ export default {
this.$message.error("已取消删除");
});
},
///获取装备模块内容
// async getClass(val) {
// if (val !== "") {
// this.searchClassData.CategoryID = val;
// const { data: res } = await this.$axios.get("api/PlanModel", {
// params: this.searchClassData,
// });
// this.MaterielOption = res.Rows;
// }
// },
///获取物料内容
async getClass(val) {
this.AddPlanForm.MaterielName = "";
......@@ -672,7 +950,27 @@ export default {
this.MaterielOption = res.Rows;
}
},
//删除装备
// deletePlanEquipment(row) {
// // this.ruleForm.PlanDetail.splice(this.$refs.planDetail.store.states.selection, 1)
// console.log(row);
// this.ruleForm.PlanModelOption.splice(row, 1);
// },
//获取警员信息
async getPoliceTyp(val){
this.PoliceOption = []
this.UserId = ''
if (val !== "") {
this.searchClassData.PoliceCategoryId = val;
const { data: res } = await this.$axios.get("api/User", {
params: this.searchClassData,
});
this.PoliceOption = res.Rows;
}
},
//获取号型
async getMateriel(val) {
this.AddPlanForm.EqSizeId = "";
......@@ -705,11 +1003,17 @@ export default {
this.title = "添加预案";
this.addVisible = true;
this.ruleForm.PlanDetail = [];
this.ruleForm.PlanPolice = [];
this.ruleForm.PlanModel = [];
// console.log("rule",this.ruleForm)
const { data: resclass } = await this.$axios.get("api/EqCategory", {
const { data: resclass } = await this.$axios.get("api/PoliceCategory", {
params: this.searchEqCategoryData,
});
this.classOption = resclass.Rows;
const { data: resPlanMod } = await this.$axios.get("api/PlanModel", {
params: this.searchEqCategoryData,
});
this.PlanModelOption = resPlanMod.Rows;
},
async getQueuData() {
this.loading = true;
......@@ -740,6 +1044,95 @@ export default {
this.resetForm();
this.addVisible = false;
},
//添加模块
changeAddPlanForm(val) {
if (val) {
this.AddPlanForm = this.PlanModelOption.find(i => i.ID == val)
} else {
this.AddPlanForm = {}
}
},
addPlanModelEquipment(){
if(this.AddPlanForm.ID==="")
{
return this.$message.warning("请选择模块");
}
console.log(this.AddPlanForm);
var PlanModel = {
ID: this.AddPlanForm.ID,
PlanModelName:this.AddPlanForm.PlanModelName,
PlanModelInfo:this.AddPlanForm.PlanModelInfo,
Remark: this.AddPlanForm.Remark,
PlanDetail:this.AddPlanForm.PlanModelDetail,
};
var obj = {};
obj = this.ruleForm.PlanModel.find(function (item) {
return (
item.ID === PlanModel.ID
);
});
console.log(obj);
if (obj === undefined) {
this.ruleForm.PlanModel.push(PlanModel);
console.log(this.ruleForm.PlanModel);
} else {
this.$message.error("该模块已添加");
}
},
//删除装备模块
deletePlanModel(row) {
// this.ruleForm.PlanDetail.splice(this.$refs.planDetail.store.states.selection, 1)
console.log(row);
this.ruleForm.PlanModel.splice(row, 1);
},
//添加警员
addPoliceCategory() {
if(this.UserId==="")
{
return this.$message.warning("请选择警员");
}
var PlanPolice = {
ID: this.AddPoliceForm.ID,
UserName:this.AddPoliceForm.UserName,
DepartName:this.AddPoliceForm.DepartName,
PoliceTypeName:this.AddPoliceForm.PoliceTypeName,
PoliceCategoryldName:this.AddPoliceForm.PoliceCategoryldName,
};
var obj = {};
obj = this.ruleForm.PlanPolice.find(function (item) {
return (
item.UserName === PlanPolice.UserName && item.PoliceCategoryId === PlanPolice.PoliceCategoryId
);
});
console.log(obj);
if (obj === undefined) {
this.ruleForm.PlanPolice.push(PlanPolice);
} else {
this.$message.error("已添加该警员");
}
},
changeAddPoliceCategoryForm(val) {
if (val) {
console.log(this.PoliceOption.find(i => i.ID == val))
var selectPolice = this.PoliceOption.find(i => i.ID == val)
this.AddPoliceForm = selectPolice
} else {
this.AddPoliceForm = {}
}
},
//删除装备模块
deletePlanPolice(row) {
// this.ruleForm.PlanDetail.splice(this.$refs.planDetail.store.states.selection, 1)
console.log(row);
this.ruleForm.PlanPolice.splice(row, 1);
},
//添加装备
addEquipment() {
if(this.AddPlanForm.MaterielId==="")
......@@ -767,13 +1160,13 @@ export default {
this.$message.error("已经存在该物资");
}
},
//删除装备
deleteEquipment(row) {
// this.ruleForm.PlanDetail.splice(this.$refs.planDetail.store.states.selection, 1)
console.log(row);
// //删除装备
// deleteEquipment(row) {
// // this.ruleForm.PlanDetail.splice(this.$refs.planDetail.store.states.selection, 1)
// console.log(row);
this.ruleForm.PlanDetail.splice(row, 1);
},
// this.ruleForm.PlanDetail.splice(row, 1);
// },
// 当前页数发生改变时
handleCurrentChange(val) {
this.searchData.Page = val;
......
<template>
<div class="body">
<!-- 面包屑导航区域 S -->
<div class="title_box">
<div class="block" style="float: left"></div>
<el-card style="height: 75px">
<el-row>
<el-col :span="2">
<img src="../../assets/images/模块.png" class="logo" alt="logo"
/></el-col>
<el-col :span="2"
><span class="fontStyle">装备模块化管理</span><br /><span></span>
</el-col>
<el-col :span="20">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/index' }"
>首页</el-breadcrumb-item
>
<el-breadcrumb-item>仓库管理 </el-breadcrumb-item>
<el-breadcrumb-item>模块化管理</el-breadcrumb-item>
</el-breadcrumb></el-col
>
</el-row>
</el-card>
</div>
<!-- 主体区域 - 卡片视图 -->
<div class="main_box">
<!-- 查询功能区域 -->
<el-form
:inline="true"
:model="searchData"
size="medium"
label-position="left"
>
<el-input
v-model="searchData.PlanModelName"
@keypress.native.enter="onEnterPress"
ref="nameInput"
style="width: 200px"
class="textboxBo"
placeholder="请输入模块名称搜索"
></el-input>
<!-- <el-select
v-model="searchData.LibaryType"
class="textboxBo"
placeholder="请选择装备类型"
>
<el-option
v-for="item in LibaryType"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> -->
<a-button
type="primary"
ghost
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
>查询</a-button
>
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addPlan()"
>添加模块</el-button
>
</el-form>
<!-- 列表区域 -->
<el-row style="margin-top: 30px">
<!-- 主表 -->
<el-table
v-loading="loading"
:data="borrowData"
stripe
style="width: 100%"
size="small"
border
highlight-current-row
>
<el-table-column prop="ID" v-if="false" />
<el-table-column prop="PlanModelName" label="模块名称" align="center">
</el-table-column>
<el-table-column prop="PlanModelInfo" label="模块信息" align="center">
</el-table-column>
<el-table-column prop="Remark" label="备注" align="center">
</el-table-column>
<el-table-column prop="CreateTime" label="创建时间" align="center">
</el-table-column>
<!-- <el-table-column prop="CreateName" label="创建人员" align="center">
</el-table-column> -->
<el-table-column label="操作" width="200" align="center">
<template v-slot="scope">
<a-button
type="primary"
class="actions"
ghost
round
size="small"
@click="watch(scope.row)"
>查看</a-button
>
<a-button
type="primary"
class="actions"
ghost
round
size="small"
@click="edit(scope.row)"
>修改</a-button
>
<a-button
type="primary"
class="actions"
ghost
round
size="small"
@click="deleteClick(scope.row)"
>删除</a-button
>
</template>
</el-table-column>
</el-table>
<el-dialog
width="70%"
:close-on-click-modal="false"
:title="title"
:visible.sync="addVisible"
@close="closeForm('ruleForm')"
>
<div style="border: 0px solid #e8e8e8">
<el-divider></el-divider>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleSet"
label-width="100px"
style="margin-top: 10px"
>
<!-- class="inputClass" -->
<el-row :gutter="90">
<el-col :span="10">
<el-form-item
label="模块名称"
class="labelClass"
prop="PlanModelName"
>
<el-input
class="planClass"
v-model="ruleForm.PlanModelName"
></el-input>
</el-form-item>
<el-form-item label="模块信息" class="labelClass">
<el-input
class="labelClassT"
type="textarea"
:rows="2"
v-model="ruleForm.PlanModelInfo"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" style="margin-top: 60px">
<el-form-item label="备注" class="labelClass">
<el-input
class="labelClassT"
type="textarea"
:rows="2"
v-model="ruleForm.Remark"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-divider></el-divider>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleSet2"
label-width="100px"
style="margin-top: 10px"
>
<el-row :gutter="10">
<el-col :span="8" class="dia">
<el-form class="diaC">大类选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MainClass"
filterable
clearable
style="width: 260px"
@change="getClass"
placeholder="请选择大类"
>
<el-option
v-for="item in classOption"
:key="item.ID"
:label="item.EqCategoryName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">物料选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.MaterielName"
filterable
clearable
style="width: 260px"
@change="getMateriel"
placeholder="请选择物料"
>
<el-option
v-for="item in MaterielOption"
:key="item.ID"
:label="item.MaterielName"
:value="item.ID"
>
</el-option>
</el-select>
<el-form class="diaC">号型选择</el-form>
<el-select
class="diaC"
v-model="AddPlanForm.EqSizeId"
filterable
clearable
style="width: 260px"
@change="getIDAndName"
placeholder="请选择号型"
>
<el-option
v-for="item in sizeOption"
:key="item.ID"
:label="item.EqSizeName"
:value="item.ID"
>
</el-option>
</el-select>
<el-button
size="small"
class="buttonClass"
type="primary"
icon="el-icon-circle-plus-outline"
round
@click="addEquipment"
>添加装备</el-button
>
</el-col>
<el-col :span="16" style="padding-top: 31px">
<el-table
:data="ruleForm.PlanModelDetail"
ref="PlanModelDetail"
height="250"
border
style="width: 100%"
>
<el-table-column
prop="MaterielId"
label="物料ID"
align="center"
v-if="false"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="物料名称"
align="center"
>
</el-table-column>
<el-table-column
prop="EqSizeName"
label="号型"
align="center"
>
</el-table-column>
<el-table-column
prop="EqCount"
label="数量"
align="center"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.EqCount"
:min="1"
:max="200"
></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="deleteEquipment(scope.$index, scope.row)"
icon="el-icon-delete"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="10"> </el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm(title)"
>提交</el-button
>
</span>
</el-dialog>
<!-- 详细信息弹出 -->
<el-dialog title="查看明细" :visible.sync="baseTableVisible">
<el-card>
<div slot="header" class="clearfix">
<span class="labelBorrow">基础信息</span>
</div>
<div style="border: 1px solid #e8e8e8">
<table
style="
table-layout: auto;
width: 100%;
border-collapse: collapse;
box-sizing: border-box;
"
>
<tbody>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">模块名称</th>
<td class="textContent">
{{ tableDataModel.PlanModelName }}
</td>
<!-- <th class="textHeader">预案状态</th>
<td class="textContentLast">
{{
detailData.PlanState === -1
? "禁用"
: detailData.PlanState === 0
? "停用"
: "开启中"
}}
</td> -->
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">模块信息</th>
<td class="textContentLast">
{{ tableDataModel.PlanModelInfo }}
</td>
</tr>
<tr>
<th class="textHeader">备注</th>
<td colspan="5" class="textContentLast">
{{ tableDataModel.Remark }}
</td>
</tr>
</tbody>
</table>
</div>
</el-card>
<el-card class="box-card" style="margin-top: 35px">
<label class="labelBorrow">装备明细表</label>
<el-divider></el-divider>
<template>
<el-table :data="tableData" border class="details" >
<el-table-column prop="MaterielName" label="物料名称" align="center" >
</el-table-column>
<el-table-column prop="EqCount" label="数量" align="center" >
</el-table-column>
<el-table-column prop="EqSizeName" label="号型" align="center">
</el-table-column>
</el-table>
</template>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="baseTableVisible = false"
>确 定</el-button
>
</div>
</el-dialog>
<!-- 分页功能 -->
<el-row type="flex" justify="center" align="middle">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchData.page"
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
/>
</el-row>
</el-row>
</div>
</div>
</template>
<script>
export default {
data() {
return {
rules: {
PlanModelName: [
{ required: true, message: "请输入模块名称", trigger: "blur" },
{ min: 1, message: "请输入模块名称", trigger: "blur" },
],
},
baseTableVisible: false,
tableData: [],
tableDataModel: [],
classOption: [],
MaterielOption: [],
sizeOption: [],
searchData: {
Page: 1,
Rows: 10,
Sort: "ID",
Order: "ASC",
PlanName: "",
},
searchEqCategoryData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
},
resetForm() {
this.$refs["ruleSet"].resetFields();
this.AddPlanForm={
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
}
},
searchClassData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
CategoryID: "",
},
searchMaterielData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
MaterielId: "",
},
title: "",
ruleForm: {
ID: 0,
PlanModelName: "",
PlanModelInfo: "",
Remark:"",
PlanModelDetail: [
{
MainClass: "",
Materiel: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EqCount: 1,
PlanModelId: ''
},
],
},
AddPlanForm: {
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
},
detailData: [],
loading: false,
tabLoading: false,
// 用户选中日期
timeData: [],
input: "",
form: {},
borrowData: [],
editData: [],
addVisible: false,
picVisible: false,
formLabelWidth: "120px",
history_Num: "",
// 总条数
total: 0,
};
},
created() {
this.getQueuData();
},
methods: {
//获取号型的名字和ID
async getIDAndName(val) {
if (val !== "") {
var obj = {};
obj = this.sizeOption.find(function (item) {
return item.ID === val;
});
// console.log(obj)
this.AddPlanForm.EqSizeId = obj.ID;
this.AddPlanForm.EqSizeName = obj.EqSizeName;
}
},
///查看详情
async watch(row) {
this.baseTableVisible = true;
const borrowUrl = "/api/PlanModel/" + row.ID;
const { data: res } = await this.$axios.get(borrowUrl);
if (res.Success == false) return this.$message(res.Remark);
this.tableData = res.PlanModelDetail;
this.tableDataModel = res;
//this.detailData = res;
},
//提交表单
submitForm(type) {
console.log("RU", this.ruleForm);
this.$refs["ruleSet"].validate(async (valid) => {
if (valid) {
if (type === "添加装备模块") {
if (
this.ruleForm.PlanModelDetail == undefined ||
this.ruleForm.PlanModelDetail.length <= 0
) {
return this.$message.error("请至少添加一个物资");
}
const { data: res } = await this.$axios.post(
"/api/PlanModel",
this.ruleForm
);
if (res.Success !== true) return this.$message.error(res.Remark);
} else {
if (
this.ruleForm.PlanModelDetail == undefined ||
this.ruleForm.PlanModelDetail.length <= 0
) {
return this.$message.error("请至少添加一个物资");
}
//修改预案类型
const { data: res } = await this.$axios.put(
"/api/PlanModel",
this.ruleForm
);
if (res.Success !== true) return this.$message.error(res.Remark);
}
this.getQueuData();
this.addVisible = false;
return this.$message.success('操作成功!');
} else {
return false;
}
});
},
//改变预案停启用状态
async changeState(row) {
const formData = new FormData();
formData.append("ID", row.ID);
formData.append("PlanState", row.PlanState);
this.ruleForm.ID = row.ID;
this.ruleForm.PlanState = row.PlanState;
const config = {
headers: {
"Content-Type": "multipart/form-data",
},
};
const { data: res } = await this.$axios.post(
"/api/PlanModel/UpdateState",
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
this.getQueuData();
},
//修改
async edit(row) {
this.title = "修改装备模块";
this.addVisible = true;
var url = "/api/PlanModel/" + row.ID;
const { data: res } = await this.$axios.get(url);
this.ruleForm = JSON.parse(JSON.stringify(res));
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
});
this.classOption = resclass.Rows;
// console.log(this.ruleForm);
},
//删除预案
deleteClick(row) {
const url = "/api/PlanModel/" + row.ID;
this.$confirm("此操作将永久删除该条数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
const { data: res } = await this.$axios.delete(url);
if (res.Success === true) {
this.getQueuData();
this.$message.success(res.Remark);
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.error("已取消删除");
});
},
///获取物料内容
async getClass(val) {
this.AddPlanForm.MaterielName = "";
this.AddPlanForm.EqSizeId = "";
if (val !== "") {
this.searchClassData.CategoryID = val;
const { data: res } = await this.$axios.get("api/Materiel", {
params: this.searchClassData,
});
this.MaterielOption = res.Rows;
}
},
//获取号型
async getMateriel(val) {
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
if (val !== "") {
var obj = {};
obj = this.MaterielOption.find(function (item) {
return item.ID === val;
});
this.AddPlanForm.MaterielId = obj.ID;
this.AddPlanForm.MaterielName = obj.MaterielName;
this.searchMaterielData.MaterielId = val;
const { data: res } = await this.$axios.get("api/EqSize", {
params: this.searchMaterielData,
});
this.sizeOption = res.Rows;
// console.log("size",this.sizeOption)
}
},
//获取详细信息
async getDetailInfo(row) {
this.picVisible = true;
this.imgurl = window._CONFIG["dlURL"] + "/" + row.ImagePath;
},
//新增预案
async addPlan() {
this.title = "添加装备模块";
this.addVisible = true;
this.ruleForm.PlanModelDetail = [];
// console.log("rule",this.ruleForm)
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
});
this.classOption = resclass.Rows;
},
async getQueuData() {
this.loading = true;
const { data: res } = await this.$axios.get("api/PlanModel", {
params: this.searchData,
});
this.total = res.Total;
this.borrowData = res.Rows;
this.timer = setTimeout(() => {
//设置延迟执行
this.loading = false;
}, 300);
},
//查询条件添加回车键
onEnterPress() {
this.getQueuData();
},
// 分页功能
// 每页显示条数发生改变时
handleSizeChange(val) {
this.searchData.Rows = val;
this.getQueuData();
},
//关闭窗口
closeForm() {
this.resetForm();
this.addVisible = false;
},
//添加装备
addEquipment() {
if(this.AddPlanForm.MaterielId==="")
{
return this.$message.warning("请选择物料添加");
}
var plan = {
EqCount: 1,
MainClass: this.AddPlanForm.MainClass,
MaterielName: this.AddPlanForm.MaterielName,
MaterielId: this.AddPlanForm.MaterielId,
EqSizeId: this.AddPlanForm.EqSizeId,
EqSizeName: this.AddPlanForm.EqSizeName,
};
var obj = {};
obj = this.ruleForm.PlanModelDetail.find(function (item) {
return (
item.EqSizeId === plan.EqSizeId && item.MaterielId === plan.MaterielId
);
});
console.log(obj);
if (obj === undefined) {
this.ruleForm.PlanModelDetail.push(plan);
} else {
this.$message.error("已经存在该物资");
}
},
//删除装备
deleteEquipment(row) {
// this.ruleForm.PlanDetail.splice(this.$refs.planDetail.store.states.selection, 1)
console.log(row);
this.ruleForm.PlanModelDetail.splice(row, 1);
},
// 当前页数发生改变时
handleCurrentChange(val) {
this.searchData.Page = val;
this.getQueuData();
},
},
};
</script>
<style scoped lang='less'>
body {
margin: 0;
}
.labelBorrow {
margin: auto;
font-weight: bold;
font-size: 16px;
}
.dia {
padding-left: 32px;
}
.inputClass {
width: 400px;
margin-top: 15px;
}
.planClass {
width: 190px !important;
}
.labelClass {
font-weight: 800;
}
.textHeader {
background-color: #fafafa;
padding: 16px 24px;
border-right: 1px solid #e8e8e8;
text-align: center;
}
.textContent {
background-color: #ffffff;
padding: 16px 24px;
border-right: 1px solid #e8e8e8;
text-align: left;
}
.textContentLast {
background-color: #ffffff;
padding: 16px 24px;
text-align: left;
}
.labelClassT {
// width: 30% !important;
}
.title_box {
margin-top: 0px;
}
.textboxBo {
margin-right: 16px;
float: left;
margin-bottom: 13px;
}
.diaC {
font-weight: 800;
margin-left: 29px;
margin-bottom: 12px;
}
.buttonClass {
line-height: 0px;
text-align: center;
width: 61%;
margin-left: 29px;
height: 31px;
font-size: larger;
}
.funcButton {
margin-right: 16px;
float: right;
margin-bottom: 13px;
}
.logo {
margin-top: -4px;
margin-left: 29px;
}
</style>
......@@ -56,7 +56,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -274,9 +274,8 @@
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchData.pageNo"
:current-page="searchData.Page"
:page-sizes="[10, 20, 30, 40]"
:page-size="searchData.Page"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
/>
......@@ -412,7 +411,10 @@ export default {
// console.log("1",this.searchData.BeginTime)
// console.log("2",this.searchData.EndTime)
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/Inventory", {
params: this.searchData,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论