Commit ee5f6e69 by T

1.首页新增消息提醒、2.维护提醒、3.储柜灯控制、4.业务流优化和其他bug优化

parent 972f2df6
......@@ -9,7 +9,7 @@
<script>
window._CONFIG = {};
// window._CONFIG['dlURL'] = 'http://192.168.2.105:5007';
//window._CONFIG['dlURL'] = 'http://192.168.3.188:5007';
// window._CONFIG['dlURL'] = 'http://192.168.3.188:5007';
window._CONFIG['dlURL'] = 'http://41.204.124.248:5001';
</script>
......
......@@ -14,7 +14,7 @@
active-text-color="#ffd04b"
>
<el-submenu :class="item.children? '' :'d-none'" v-for="item in asidList" :key="item.id" :index="item.id.toString()">
<template slot="title" style="text-algin: left" >
<template slot="title" style="text-algin:left" >
<div @click="aa(item)">
<svg-icon :icon-class="item.icon" class="svgicon"></svg-icon>
<span slot="title" >{{ item.menuName }}</span>
......@@ -34,7 +34,7 @@
import SvgIcon from '../SvgIcon/index.vue'
export default {
name: 'bo-big-aside',
components: [SvgIcon],
components: {SvgIcon},
props: {
// v-if="item.path === this.$route.path.split('/')[1]"
......@@ -112,7 +112,7 @@ export default {
height: 80px;
width: 100%;
padding: 0 2px;
background: radial-gradient(ellipse at center, #012a47 0% 80%) !important;
//background: radial-gradient(ellipse at center, #012a47 0% 80%) !important;
user-select: none;
cursor: pointer;
box-sizing: border-box;
......
<?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="1677402465080" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="32854" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M578.236052 421.891749 337.761142 421.891749c-7.384178 0-13.360286-5.982248-13.360286-13.359262 0-7.378038 5.975085-13.360286 13.360286-13.360286l240.47491 0c7.384178 0 13.360286 5.982248 13.360286 13.360286C591.596338 415.910525 585.620229 421.891749 578.236052 421.891749z" fill="#bfbfbf" p-id="32855"></path><path d="M685.114245 421.891749l-40.079834 0c-7.384178 0-13.360286-5.982248-13.360286-13.359262 0-7.378038 5.976108-13.360286 13.360286-13.360286l40.079834 0c7.384178 0 13.359262 5.982248 13.359262 13.360286C698.473507 415.910525 692.498422 421.891749 685.114245 421.891749z" fill="#bfbfbf" p-id="32856"></path><path d="M498.077408 555.490513l-146.957003 0c-7.384178 0-13.360286-5.976108-13.360286-13.361309 0-7.377014 5.975085-13.359262 13.360286-13.359262l146.957003 0c7.384178 0 13.359262 5.982248 13.359262 13.359262C511.437693 549.514405 505.462608 555.490513 498.077408 555.490513z" fill="#bfbfbf" p-id="32857"></path><path d="M578.236052 555.490513l-26.719548 0c-7.384178 0-13.359262-5.976108-13.359262-13.361309 0-7.377014 5.975085-13.359262 13.359262-13.359262l26.719548 0c7.384178 0 13.360286 5.982248 13.360286 13.359262C591.596338 549.514405 585.620229 555.490513 578.236052 555.490513z" fill="#bfbfbf" p-id="32858"></path><path d="M274.34174 729.322607c-92.161003-65.455781-143.369292-159.352311-140.472312-257.605056 5.101181-172.965353 177.446411-319.094502 376.342344-319.094502 70.425979 0 137.784086 18.415418 195.581444 49.590442-0.404206-4.168949-0.639566-8.389064-0.639566-12.662391 0-15.721053 2.975774-30.711466 8.18031-44.61922-60.888765-29.074176-130.231063-45.747927-203.122187-45.747927-227.024573 0-423.831938 169.880085-429.754834 370.953613-3.432169 116.428709 55.95643 226.77591 162.938999 302.760488 12.042267 8.55791 28.702716 5.714142 37.261649-6.315846C289.20117 754.555292 286.370705 737.868237 274.34174 729.322607z" fill="#bfbfbf" p-id="32859"></path><path d="M836.168566 317.011051c31.794124 46.223764 50.359968 98.958826 50.359968 153.917532 0 182.882214-168.81073 331.664795-376.316761 331.664795-4.488221 0-8.897647 1.121544-12.837376 3.273557l-121.360022 66.447365 0.678452-1.616824c10.476609-22.074761 24.684192-62.482053 2.12643-85.064374-10.437723-10.4367-27.359115-10.425444-37.795814 0-9.028631 9.027607-10.254551 22.908756-3.653203 33.255405-0.352017 6.066159-4.383844 19.178805-9.471722 30.045293l-30.528294 73.100902c-4.370541 10.476609-1.657756 22.571065 6.783497 30.163997 5.02341 4.527107 11.428284 6.848988 17.874089 6.848988 4.397147 0 8.806573-1.069355 12.837376-3.273557l182.275393-99.793844c233.781464-3.340071 422.826028-174.771489 422.826028-385.05068 0-60.086493-17.612123-117.347638-48.350195-168.190607C874.941638 311.419705 856.128153 316.482001 836.168566 317.011051z" fill="#bfbfbf" p-id="32860"></path><path d="M955.623191 177.502693c0 61.788252-50.100048 111.874997-111.87602 111.874997-61.788252 0-111.873973-50.085722-111.873973-111.874997 0-61.782112 50.085722-111.867834 111.873973-111.867834C905.523143 65.63486 955.623191 115.720581 955.623191 177.502693z" fill="#bfbfbf" p-id="32861"></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="1677402465080" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="32854" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M578.236052 421.891749 337.761142 421.891749c-7.384178 0-13.360286-5.982248-13.360286-13.359262 0-7.378038 5.975085-13.360286 13.360286-13.360286l240.47491 0c7.384178 0 13.360286 5.982248 13.360286 13.360286C591.596338 415.910525 585.620229 421.891749 578.236052 421.891749z" fill="#bfbfbf" p-id="32855"></path><path d="M685.114245 421.891749l-40.079834 0c-7.384178 0-13.360286-5.982248-13.360286-13.359262 0-7.378038 5.976108-13.360286 13.360286-13.360286l40.079834 0c7.384178 0 13.359262 5.982248 13.359262 13.360286C698.473507 415.910525 692.498422 421.891749 685.114245 421.891749z" fill="#bfbfbf" p-id="32856"></path><path d="M498.077408 555.490513l-146.957003 0c-7.384178 0-13.360286-5.976108-13.360286-13.361309 0-7.377014 5.975085-13.359262 13.360286-13.359262l146.957003 0c7.384178 0 13.359262 5.982248 13.359262 13.359262C511.437693 549.514405 505.462608 555.490513 498.077408 555.490513z" fill="#bfbfbf" p-id="32857"></path><path d="M578.236052 555.490513l-26.719548 0c-7.384178 0-13.359262-5.976108-13.359262-13.361309 0-7.377014 5.975085-13.359262 13.359262-13.359262l26.719548 0c7.384178 0 13.360286 5.982248 13.360286 13.359262C591.596338 549.514405 585.620229 555.490513 578.236052 555.490513z" fill="#bfbfbf" p-id="32858"></path><path d="M274.34174 729.322607c-92.161003-65.455781-143.369292-159.352311-140.472312-257.605056 5.101181-172.965353 177.446411-319.094502 376.342344-319.094502 70.425979 0 137.784086 18.415418 195.581444 49.590442-0.404206-4.168949-0.639566-8.389064-0.639566-12.662391 0-15.721053 2.975774-30.711466 8.18031-44.61922-60.888765-29.074176-130.231063-45.747927-203.122187-45.747927-227.024573 0-423.831938 169.880085-429.754834 370.953613-3.432169 116.428709 55.95643 226.77591 162.938999 302.760488 12.042267 8.55791 28.702716 5.714142 37.261649-6.315846C289.20117 754.555292 286.370705 737.868237 274.34174 729.322607z" fill="#bfbfbf" p-id="32859"></path><path d="M836.168566 317.011051c31.794124 46.223764 50.359968 98.958826 50.359968 153.917532 0 182.882214-168.81073 331.664795-376.316761 331.664795-4.488221 0-8.897647 1.121544-12.837376 3.273557l-121.360022 66.447365 0.678452-1.616824c10.476609-22.074761 24.684192-62.482053 2.12643-85.064374-10.437723-10.4367-27.359115-10.425444-37.795814 0-9.028631 9.027607-10.254551 22.908756-3.653203 33.255405-0.352017 6.066159-4.383844 19.178805-9.471722 30.045293l-30.528294 73.100902c-4.370541 10.476609-1.657756 22.571065 6.783497 30.163997 5.02341 4.527107 11.428284 6.848988 17.874089 6.848988 4.397147 0 8.806573-1.069355 12.837376-3.273557l182.275393-99.793844c233.781464-3.340071 422.826028-174.771489 422.826028-385.05068 0-60.086493-17.612123-117.347638-48.350195-168.190607C874.941638 311.419705 856.128153 316.482001 836.168566 317.011051z" fill="#bfbfbf" p-id="32860"></path><path d="M955.623191 177.502693c0 61.788252-50.100048 111.874997-111.87602 111.874997-61.788252 0-111.873973-50.085722-111.873973-111.874997 0-61.782112 50.085722-111.867834 111.873973-111.867834C905.523143 65.63486 955.623191 115.720581 955.623191 177.502693z" fill="#bfbfbf" p-id="32861"></path></svg>
\ No newline at end of file
......@@ -33,7 +33,7 @@ Vue.config.productionTip = false
//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'
......
......@@ -30,6 +30,13 @@ const warehouse = [
name: 'warehouseInventory',
component: () => import('@/warehouse/warehouseInventory')
}
,
{
//维护提醒
path: '/warehouse/equMaintenanceReminder',
name: 'equMaintenanceReminder',
component: () => import('@/warehouse/equMaintenanceReminder')
}
]
......
......@@ -17,7 +17,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
>
......@@ -69,7 +69,7 @@
v-model="searchData.IsHaoCai"
filterable
clearable
placeholder="请选择是否贴标"
placeholder="是否贴标"
>
<el-option
v-for="item in optionsEquipment"
......@@ -215,7 +215,7 @@
</td>
<th class="textHeader">是否贴标</th>
<td class="textContentLast">
{{ detailData.IsHaoCai == 1 ? "未贴标" : "已贴标" }}
{{ detailData.IsHaoCai == 1 ? "否" : "是" }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
......@@ -250,7 +250,7 @@
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">使用说明</th>
<td class="textContentLast">
<span v-html="detailData.Instructions">
<span>
{{ detailData.Instructions }}
</span>
</td>
......@@ -278,8 +278,8 @@
</el-card>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click="borrowTableVisible = false">取 消</el-button> -->
<el-button type="primary" @click="borrowTableVisible = false"
>确 定</el-button
<el-button @click="borrowTableVisible = false"
>关 闭</el-button
>
</div>
</el-dialog>
......@@ -329,7 +329,7 @@
class="inputA"
:disabled="codeDis"
v-model="EditRuleForm.Code"
placeholder="请输入编码"
placeholder="请输入编码(必须5位)"
></el-input>
</el-form-item>
<el-form-item class="diaB" label="是否贴标">
......@@ -341,7 +341,7 @@
>
</el-form-item>
<el-form-item class="diaB" label="保养周期">
<el-form-item class="diaB" label="保养周期(天)">
<el-input-number
class="inputA"
v-model="EditRuleForm.TermDays"
......@@ -441,8 +441,9 @@
controls="controls">
您的浏览器不支持视频播放
</video>
<i v-else-if="videoForm.storageurl =='' && !videoFlag"
class="el-icon-plus avatar-uploader-icon"></i>
<!-- <i v-else-if="videoForm.storageurl =='' && !videoFlag"
class="el-icon-plus avatar-uploader-icon"></i> -->
<el-button size="small" type="primary">点击上传 <i class="el-icon-film"></i></el-button>
<el-progress v-if="videoFlag == true"
type="circle"
v-bind:percentage="videoUploadPercent"
......@@ -450,13 +451,21 @@
</el-upload>
</el-form-item>
<el-form-item class="diaC" label="使用说明">
<quill-editor
<!-- <quill-editor
ref="text"
style="height: 200px; width: 88%"
v-model="EditRuleForm.Instructions"
class="myQuillEditor"
:options="editorOption"
/>
/> -->
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
v-model="EditRuleForm.Instructions"
class="areaClass"
placeholder="请输入使用说明"
>
</el-input>
</el-form-item>
<el-form-item v-if="false">
......@@ -542,11 +551,11 @@ export default {
},
{
value: "1",
label: "未贴标",
label: "",
},
{
value: "0",
label: "已贴标",
label: "",
},
],
videoForm: {
......@@ -885,7 +894,7 @@ console.log("up")
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消删除");
});
},
......@@ -904,9 +913,9 @@ console.log("up")
},
stateFormat(row) {
if (row.IsHaoCai === 0) {
return "已贴标";
return "";
} else {
return "未贴标";
return "";
}
},
closeForm() {
......@@ -924,24 +933,24 @@ body {
font-size: 15px;
}
.avatar-uploader-icon {
border: 1px dashed #d9d9d9 !important;
border: 10px dashed #d9d9d9 !important;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9 !important;
border: 10px dashed #d9d9d9 !important;
border-radius: 6px !important;
position: relative !important;
overflow: hidden !important;
}
.avatar-uploader .el-upload:hover {
border: 1px dashed #d9d9d9 !important;
border: 10px dashed #d9d9d9 !important;
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
font-size: 100px;
color: #8c939d;
width: 300px;
height: 178px;
line-height: 178px;
width: 50px;
height: 48px;
line-height: 48px;
text-align: center;
}
.avatar {
......@@ -994,7 +1003,7 @@ body {
min-height: 192px;
}
.diaC {
font-weight: 1000;
font-weight: 300;
margin-left: 29px;
margin-bottom: 12px;
}
......
......@@ -17,7 +17,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
>
......@@ -33,6 +33,21 @@
size="medium"
label-position="left"
>
<el-select
style="width: 150px"
v-model="searchData.LibraryID"
class="textboxBo"
placeholder="请选择仓库"
@change="libraryChang"
>
<el-option
v-for="item in LibraryList"
:key="item.ID"
:label="item.LibaryName"
:value="item.ID"
>
</el-option>
</el-select>
<el-input
v-model="searchData.EqName"
@keypress.native.enter="onEnterPress"
......@@ -42,6 +57,7 @@
placeholder="请输入装备名称搜索"
></el-input>
<el-select
style="width: 150px"
v-model="searchData.IsPublic"
class="textboxBo"
placeholder="请选择装备类型"
......@@ -55,9 +71,10 @@
</el-option>
</el-select>
<el-select
style="width: 120px"
v-model="searchData.State"
class="textboxBo"
placeholder="请选择装备状态"
placeholder="请选择状态"
>
<el-option
v-for="item in StateType"
......@@ -68,6 +85,7 @@
</el-option>
</el-select>
<el-select
style="width: 120px"
class="textboxBo"
v-model="searchData.CategoryID"
filterable
......@@ -112,7 +130,7 @@
style="height: 40px"
class="funcButton"
@click="addEquipment()"
>添加装备(贴标)</el-button
>添加装备(贴标)</el-button
>
</el-form>
......@@ -130,20 +148,26 @@
>
<el-table-column prop="ID" v-if="false" />
<el-table-column prop="EqName" label="装备名称" align="center" />
<el-table-column label="基本信息" align="center">
<el-table-column prop="UserName" label="所属人员" align="center">
<!-- <el-table-column label="基本信息" align="center"> -->
<el-table-column prop="EqCount" label="装备数量" align="center">
</el-table-column>
<el-table-column prop="EqCode" label="装备编号" align="center">
</el-table-column>
<el-table-column
prop="LocationName"
label="储位名称"
label="所属储位"
align="center"
>
</el-table-column>
<el-table-column prop="EqCode" label="编号" align="center">
</el-table-column>
<el-table-column
prop="StateName"
label="装备状态"
align="center"
>
</el-table-column>
<!-- </el-table-column> -->
<el-table-column label="装备信息" align="center">
<!-- <el-table-column label="装备信息" align="center"> -->
<el-table-column
prop="CategoryName"
label="装备类型"
......@@ -156,9 +180,9 @@
align="center"
>
</el-table-column>
</el-table-column>
<!-- </el-table-column> -->
<el-table-column prop="LibraryName" label="仓库名称" align="center" />
<el-table-column prop="LibraryName" label="所属仓库" align="center" />
<el-table-column prop="CreateTime" label="创建时间" align="center" />
<el-table-column
prop="EqHaoCai"
......@@ -167,7 +191,7 @@
align="center"
/>
<el-table-column prop="LabelEpc" label="EPC编码" align="center" />
<!-- <el-table-column prop="LabelEpc" label="EPC编码" align="center" /> -->
<el-table-column prop="Remarks" label=" 备注" align="center" />
<el-table-column label="操作" width="200" align="center">
<template v-slot="scope">
......@@ -228,9 +252,9 @@
<td class="textContent">
{{ detailData.EqCode }}
</td>
<th class="textHeader">装备</th>
<th class="textHeader">装备</th>
<td class="textContentLast">
{{ detailData.EqTypeName }}
{{ detailData.EqSizeName }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
......@@ -244,9 +268,10 @@
<td class="textContent">
{{ detailData.UserName ? detailData.UserName : "无所属" }}
</td>
<th class="textHeader">所在柜号</th>
<th class="textHeader">所在储位</th>
<td class="textContentLast">
{{ detailData.LocationName }}
{{ detailData.LocationName }}<br> <span v-if="detailData.LibraryName =='一号仓库'" style="margin-left: 0px">
灯开关:<el-switch v-model="open" :active-open="true" :inactive-open="false" @change="changeLight()"></el-switch></span>
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
......@@ -262,8 +287,8 @@
<td class="textContentLast">
{{
detailData.BaoYangDays
? detailData.BaoYangDays + "天"
: "-天"
? detailData.BaoYangDays + " 天"
: "- 天"
}}
</td>
</tr>
......@@ -276,7 +301,7 @@
: "无需保养"
}}
</td>
<th class="textHeader">注册时间</th>
<th class="textHeader">贴标时间</th>
<td class="textContent">
{{ detailData.LabelTime }}
</td>
......@@ -292,11 +317,11 @@
</td>
<th class="textHeader">采购日期</th>
<td class="textContent">
{{ detailData.BuyTime ? detailData.BuyTime : "暂无" }}
{{ (detailData.BuyTime ? detailData.BuyTime : "暂无" ||' ').split(' ')[0] }}
</td>
<th class="textHeader">报废期限</th>
<td class="textContentLast">
{{ detailData.TermTime ? detailData.TermTime : "暂无" }}
{{ (detailData.TermTime ? detailData.TermTime : "暂无" ||' ').split(' ')[0] }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
......@@ -405,10 +430,10 @@
</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 @click="borrowTableVisible = false">关 闭</el-button>
<!-- <el-button type="primary" @click="borrowTableVisible = false"
>确 定</el-button
>
> -->
</div>
</el-dialog>
<el-dialog
......@@ -473,7 +498,6 @@
filterable
style="width: 470px"
clearable
:disabled="classDis"
@change="getIDAndName"
placeholder="请选择号型"
>
......@@ -504,7 +528,7 @@
>
</el-date-picker>
</el-form-item>
<el-form-item class="diaB" label="保养周期">
<el-form-item class="diaB" label="保养周期(天)">
<template>
<el-input-number
v-model="ruleForm.BaoYangDays"
......@@ -563,6 +587,7 @@
<el-divider content-position="left"> 位置信息</el-divider>
<el-form
:rules="rules"
:model="ruleForm"
ref="ruleForm2"
label-width="100px"
......@@ -625,7 +650,7 @@
</el-form-item>
</el-col>
<el-col :span="10" style="padding-left: 0px">
<el-form-item label="储柜选择" v-if="selectShow" class="diaB">
<el-form-item label="储柜选择" v-if="selectShow" class="diaB" prop="LocationId">
<el-select
v-model="ruleForm.LocationId"
style="width: 204px"
......@@ -706,6 +731,8 @@ export default {
{ min: 1, message: "请输入装备名称", trigger: "blur" },
],
IsPublic: [{ required: true, message: "请选择类型", trigger: "blur" }],
LibraryID: [{ required: true, message: "请选择仓库", trigger: "blur" }],
LocationId: [{ required: true, message: "请选择储位", trigger: "blur" }],
},
videoUrl:"",
videoUrlSrc:"",
......@@ -747,6 +774,7 @@ export default {
],
aaa: "",
open: false,
classDis: false,
peopleShow: false,
warehouseSelect: true,
......@@ -754,6 +782,7 @@ export default {
sizeOption: [],
MaterielOption: [],
classOption: [],
LibraryList:[],
addVisible: false,
warehouseOption: [],
options: [],
......@@ -920,7 +949,7 @@ export default {
classNewName:"",
classNewCode:"",
detailData: [],
LocationCode:'',
fixdetailData: [],
loading: false,
tabLoading: false,
......@@ -943,17 +972,37 @@ export default {
created() {
this.InitQuery();
this.getQueuData();
this.getUserInfo();
this.getLibraryList();
},
methods: {
//改变灯光状态
async changeLight(){
//console.log('改变灯光状态')
this.code= this.LocationCode;
this.isOpen= this.open;
console.log('开关的cod:'+ this.code +'....'+this.isOpen)
const { data: res } = await this.$axios.post("api/Storage/ControlStorageLight",
{code: this.code,isOpen: this.isOpen}
);
if (res.Success !== true) return this.$message.error(res.Remark);
// 提交信息成功后要关闭对话框,并且刷新数据
if(this.isOpen==true){
this.$message.success("灯光已打开,若未手动开闭,5分钟后自动关闭!");
}else{
this.$message.success("已手动开闭!");
}
},
// 获取当前选中部门的名称
selectDepart(node) {
console.log(node);
this.searchData.userID = node.ID;
// console.log("parentId", ruleForm.parentId);
},
//提交表单
submitForm(formName, type) {
console.log("RU", this.ruleForm);
......@@ -1025,13 +1074,13 @@ export default {
},
};
if (type === "添加装备(贴标)") {
if (type === "添加装备(贴标)") {
const { data: res } = await this.$axios.post(
"/api/Equipment",
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
} else {
//修改
console.log(that.ruleForm.IsPublic, formData)
......@@ -1040,7 +1089,7 @@ export default {
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
}
this.getQueuData();
this.addVisible = false;
......@@ -1049,6 +1098,24 @@ export default {
}
});
},
//获取仓库列表
async getLibraryList(){
const { data: lib } = await this.$axios.get("api/Libary", {
});
this.LibraryList = lib.Rows;
if (this.LibraryList.length > 0) {
this.searchData.LibraryID = this.LibraryList[0].ID
this.getQueuData(1);
}
//console.log(this.LibraryList)
},
//切换仓库
async libraryChang(val){
console.log('aa')
this.searchData.LibraryID=val;
this.getQueuData(1);
},
//查看信息
async check(row) {
this.borrowTableVisible = true;
......@@ -1056,7 +1123,9 @@ export default {
const { data: res } = await this.$axios.get(borrowUrl);
if (res.Success == false) return this.$message(res.Remark);
this.detailData = res;
console.log("ro",row)
this.LocationCode = res.LocationCode;
console.log(this.LocationCode);
//console.log("ro",row)
this.videoUrl=row.VideoUrl;
this.videoUrlSrc=window._CONFIG['dlURL']+'/'+this.videoUrl;
},
......@@ -1078,14 +1147,14 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消删除");
});
},
//添加装备
async addEquipment() {
this.classDis = false;
this.title = "添加装备(贴标)";
this.title = "添加装备(贴标)";
this.addVisible = true;
const { data: resclass } = await this.$axios.get("api/EqCategory", {
params: this.searchEqCategoryData,
......@@ -1150,16 +1219,16 @@ export default {
//获取号型的名字和ID
async getIDAndName(val) {
this.ruleForm.EqCode="";
this.ruleForm.EqName="";
// this.ruleForm.EqCode="";
// this.ruleForm.EqName="";
if (val !== "") {
var obj = {};
obj = this.sizeOption.find(function (item) {
return item.ID === val;
});
console.log(obj)
this.ruleForm.EqCode=this.eqNewCode+obj.Code;
this.ruleForm.EqName=this.eqNewName+"("+obj.EqSizeName+")";
// this.ruleForm.EqCode=this.eqNewCode+obj.Code;
// this.ruleForm.EqName=this.eqNewName+"("+obj.EqSizeName+")";
this.ruleForm.EqSizeId = obj.ID;
this.ruleForm.EqSizeName = obj.EqSizeName;
}
......@@ -1196,6 +1265,7 @@ export default {
console.log("mater", resMaterie.Rows);
if (this.ruleForm.EqSizeId !== null) {
this.searchMaterielData.EqSizeId = this.ruleForm.EqSizeId;
this.searchMaterielData.MaterielId=this.ruleForm.MaterielId;
const { data: resSize } = await this.$axios.get("api/EqSize", {
params: this.searchMaterielData,
});
......@@ -1334,7 +1404,7 @@ export default {
// console.log("statet",aa)
this.loading = true;
const { data: resclass } = await this.$axios.get("api/EqCategory");
const { data: resclass } = await this.$axios.get("api/EqCategory",{params: this.searchEqCategoryData,});
this.classOption = resclass.Rows;
const { data: res } = await this.$axios.get("api/Equipment", {
params: this.searchData,
......@@ -1370,9 +1440,9 @@ export default {
},
stateFormat(row) {
if (row.EqHaoCai === 0) {
return "已贴标";
return "";
} else {
return "未贴标";
return "";
}
},
},
......
......@@ -17,7 +17,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
>
......@@ -111,6 +111,15 @@
@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>
......@@ -145,7 +154,7 @@
<!-- </el-card> -->
<div slot="footer" class="dialog-footer">
<el-button @click="addVisible = false,resetForm('ruleForm')">取 消</el-button>
<el-button @click="resetForm('ruleForm')">重 置</el-button>
<el-button @click="resetForm('ruleForm')" v-if="title !== '修改大类'">重 置</el-button>
<el-button type="primary" @click="submitForm('ruleForm', title)"
>提交</el-button
>
......@@ -290,13 +299,34 @@ export default {
this.addVisible = true;
this.codeDis=true;
this.$nextTick(async()=>{
await this.resetForm('ruleForm')
//await this.resetForm('ruleForm')
this.ruleForm = JSON.parse(JSON.stringify(row));;
})
},
//删除大类
deleteClick(row) {
const url = "/api/EqCategory/" + 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("已删除该数据");
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.warning("已取消删除");
});
},
//获取详细信息
async getDetailInfo(row) {
this.picVisible = true;
......
......@@ -17,7 +17,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
>
......@@ -43,7 +43,7 @@
></el-input>
<el-select
class="textboxBo"
v-model="searchData.ClassID"
v-model="searchData.CategoryId"
filterable
clearable
placeholder="请选择类型"
......@@ -278,11 +278,11 @@ export default {
},
{
value: "1",
label: "贴标",
label: "贴标",
},
{
value: "0",
label: "贴标",
label: "贴标",
},
],
searchEqCategoryData: {
......@@ -556,7 +556,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消删除");
});
},
......@@ -575,9 +575,9 @@ export default {
},
stateFormat(row) {
if (row.EqHaoCai === 0) {
return "贴标";
return "贴标";
} else {
return "贴标";
return "贴标";
}
},
closeForm() {
......
......@@ -17,7 +17,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
>
......@@ -78,17 +78,17 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
<!-- <el-button
type="primary"
icon="el-icon-plus"
style="height: 40px; margin-left: 10px"
class="funcButton"
@click="addRecive(0)"
>借用下发(贴标)</el-button
>借用下发(贴标)</el-button
>
<el-button
type="primary"
......@@ -96,8 +96,34 @@
style="height: 40px"
class="funcButton"
@click="addRecive(1)"
>借用下发(已贴标)</el-button
>借用下发(贴标)</el-button
> -->
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addIssued()"
>借用下发</el-button
>
<el-dialog :visible.sync="addIssuedDialogVisible" title="请选择要创建的维修下发单据类型" width="500px" align="center">
<div slot="footer" class="dialog-footer" align="center">
<el-button
type="warning"
icon="el-icon-box"
@click="addRecive(0)"
>借用下发(不贴标)</el-button
>
<el-button
type="success"
icon="el-icon-box"
@click="addRecive(1)"
>借用下发(贴标)</el-button
>
<!-- <el-button type="primary" @click="clickOrderType">确认</el-button> -->
</div>
</el-dialog>
</el-form>
<!-- 列表区域 -->
......@@ -118,12 +144,7 @@
label="申请人"
align="center"
/>
<el-table-column
prop="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column
prop="IsHaoCai"
label="单据类型"
......@@ -140,15 +161,21 @@
align="center"
/>
<el-table-column prop="ExamineTime" label="审核时间" align="center" />
<el-table-column
prop="ExamineStateName"
label="审核状态"
align="center"
/>
<el-table-column prop="LyTime" label="借用时间" align="center" />
<el-table-column
prop="SubmitStateName"
label="状 态"
prop="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column
fixed="right"
label="操作"
align="center"
>
......@@ -163,6 +190,16 @@
style="font-size: 15px"
>查看</a-button
>
<!-- <a-button
type="primary"
class="actions"
v-if="[-3].includes(scope.row.SubmitState)"
ghost
round
size="small"
@click="editStagingForm(scope.row)"
>编辑</a-button
> -->
<a-button
type="primary"
class="actions"
......@@ -360,148 +397,23 @@
>
</div>
</el-dialog>
<!-- 新增/编辑 耗材 -->
<!-- 引入新增/编辑 耗材(不贴标)组件 -->
<borrowGetNTBForm ref="borrowGetNTBForm" />
<!-- 新增/编辑 非耗材-->
<el-dialog
width="70%"
:close-on-click-modal="false"
:title="title"
:visible.sync="addVisible"
: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, '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"
:model="NHCruleForm"
ref="NHCruleForm"
label-position="left"
style="margin-top: 30px"
>
......@@ -522,9 +434,9 @@
>人员选择
<el-select
class="diaD"
v-model="ruleForm.userID"
v-model="ruleForm.submitUserName"
placeholder="请选择人员"
@change="policeSelect"
@change="NHCpoliceSelect"
>
<el-option
v-for="item in policeOptions"
......@@ -544,29 +456,14 @@
<el-input
type="textarea"
:autosize="{ minRows: 6, maxRows: 50 }"
v-model="ruleForm.Remarks"
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="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-divider></el-divider>
<el-form
:model="ruleForm"
ref="ruleForm"
......@@ -707,61 +604,10 @@
<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="warning" @click="stagingForm(0)">暂存</el-button> -->
<el-button type="primary" @click="submitForm(0)">提交</el-button>
</span>
</el-dialog>
......@@ -786,11 +632,14 @@
<script>
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import borrowGetNTBForm from './borrowGetNTBForm'
export default {
components: { Treeselect },
components: { Treeselect, borrowGetNTBForm },
data() {
return {
loading: false,
departId: '',
addIssuedDialogVisible:false,
searchData: {
Page: 1,
Rows: 10,
......@@ -841,7 +690,7 @@ export default {
PlanState: 0,
borrowType: 1,
IsHaoCai: 0,
isDraft:false,
submitUsrID: "",
submitUserName: "",
BorrowList: [
......@@ -864,6 +713,7 @@ export default {
IsHaoCai: 1,
submitUsrID: "",
submitUserName: "",
isDraft:false,
BorrowList: [
{
MainClass: "",
......@@ -904,6 +754,7 @@ export default {
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EquipmentId: '',
EqSizeCode: "",
}),
(this.ruleForm = {
......@@ -1083,6 +934,7 @@ export default {
this.AddPlanForm.parentName = node.DepartName;
this.AddPlanForm.parentId = node.ID;
this.searchUserData.DeparId = node.ID;
this.ruleForm.submitUserName='';
const { data: res } = await this.$axios.get("api/User", {
params: this.searchUserData,
});
......@@ -1143,6 +995,117 @@ export default {
{ this.searchData.SubmitState=this.$route.query.options;}
},
///提交表单(暂存)
async stagingForm(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=1;
this.NHCruleForm.isDraft=true;
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=1;
this.ruleForm.isDraft=true;
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 editStagingForm(row) {
console.log(row.IsHaoCai);
// 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.NHCruleForm = 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.Visible = true;
// var url = "api/Borrow/" + 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;
// }
if (row.IsHaoCai === 0) {
const borrowUrl = "/api/Department/" + 0;
const { data: resdepartment } = await this.$axios.get(borrowUrl);
this.departOptions = resdepartment;
//耗材1
this.title = "借用下发(不贴标物资)";
this.addVisible = true;
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
this.departId = res.DeparId
console.log(this.departId)
} //非耗材0
else {
this.title = "借用下发(贴标物资)";
this.NHCaddVisible = true;
//this.NHCruleForm.BorrowList = [];
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
this.ruleForm.BorrowList = JSON.parse(JSON.stringify(res));
console.log('tb'+this.ruleForm)
}
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;
},
///提交表单
async submitForm(ishaocai) {
console.log("renyuan",this.NHCruleForm)
......@@ -1164,6 +1127,7 @@ export default {
this.searchData.SubmitState="1";
this.getQueuData();
this.NHCaddVisible = false;
this.addIssuedDialogVisible =false;
if (res.Success !== true) return this.$message.error(res.Remark);
else
{
......@@ -1185,6 +1149,7 @@ export default {
this.searchData.SubmitState="1";
this.getQueuData();
this.addVisible = false;
this.addIssuedDialogVisible =false;
if (res.Success !== true) return this.$message.error(res.Remark);
else
{
......@@ -1241,14 +1206,16 @@ export default {
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.sizeOption = [];
......@@ -1311,15 +1278,27 @@ export default {
};
console.log("添加物资", plan);
obj = this.ruleForm.BorrowList.find(function (item) {
return item.EqSizeId === plan.EqSizeId;
return (
item.EqSizeId === plan.EqSizeId &&
item.MaterielCode === plan.MaterielCode
);
});
console.log("obj", obj);
if (obj === undefined) {
this.ruleForm.BorrowList.push(plan);
// this.AddPlanForm.EqSizeId="";
// this.AddPlanForm.EqSizeName="";
} else {
this.$message.error("已经存在该物资");
}
// obj = this.ruleForm.BorrowList.find(function (item) {
// return item.MaterielId === plan.MaterielId;
// });
// if (obj == undefined) {
// this.ruleForm.BorrowList.push(plan);
// this.AddPlanForm.EqSizeId="";
// this.AddPlanForm.EqSizeName="";
// } else {
// this.$message.error("已经存在该物资");
// }
},
//删除装备
deleteEquipment(row) {
......@@ -1330,9 +1309,9 @@ export default {
},
stateFormat(row) {
if (row.IsHaoCai === 0) {
return "贴标";
return "贴标";
} else if(row.IsHaoCai===1) {
return "贴标";
return "贴标";
}
else
{
......@@ -1355,16 +1334,21 @@ export default {
}
},
//下发借用
addIssued(){
this.addIssuedDialogVisible = true;
},
async addRecive(row) {
console.log(row);
this.addIssuedDialogVisible = false;
//console.log(row);
if (row === 0) {
//耗材0
this.title = "借用下发(未贴标物资)";
this.addVisible = true;
this.ruleForm.BorrowList = [];
console.log('btb');
const _this = this.$refs.borrowGetNTBForm
_this.editVisible = true;
_this.addRecive()
} //非耗材1
else {
this.title = "借用下发(贴标物资)";
this.title = "借用下发(贴标物资)";
this.NHCaddVisible = true;
this.NHCruleForm.BorrowList = [];
}
......@@ -1411,19 +1395,10 @@ export default {
}
})
.catch((e) => {
this.$message.error(""+stateName+"操作");
this.$message.warning("已取消"+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 = {};
......@@ -1478,7 +1453,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;
this.searchData.borrowType = 1;
const { data: res } = await this.$axios.get("api/Borrow", {
......
<template>
<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-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.submitUserName"
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>
<el-divider style="margin-bottom: 35px"></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.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="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>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取 消</el-button>
<!-- <el-button type="warning" @click="stagingForm(1)">暂存</el-button> -->
<el-button type="primary" @click="submitForm(1)">提交</el-button>
</span>
</el-dialog>
</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: "",
},
AddPlanForm: {
parentName: "",
parentId: "",
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
},
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: 0,
IsHaoCai: 0,
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.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,
},
],
});
},
searchMaterielData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ESC",
MaterielId: "",
},
auditbutton: false,
editForm: {
ID: "",
SubmitState: 0,
exameReason: "",
},
addVisible: false,
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.getQueuData();
},
methods: {
//下发领用
async addRecive() {
this.title = "借用下发(不贴标物资)";
this.addVisible = true;
this.ruleForm.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;
console.log("rule", this.ruleForm);
this.classOption = resclass.Rows;
},
// 获取当前选中部门的名称
async selectDepart(node) {
console.log(node);
this.AddPlanForm.parentName = node.DepartName;
this.AddPlanForm.parentId = node.ID;
this.searchUserData.DeparId = node.ID;
this.ruleForm.submitUserName='';
const { data: res } = await this.$axios.get("api/User", {
params: this.searchUserData,
});
this.policeOptions = res.Rows;
},
///人员选择
policeSelect(row) {
var obj = {};
obj = this.policeOptions.find(function (item) {
return item.ID === row;
});
console.log(obj)
this.ruleForm.submitUsrID = row;
this.ruleForm.submitUserName = row;
},
///获取类别的ID和内容
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;
} else {
this.sizeOption = [];
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
}
},
//物料选择后
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.MaterielCode = obj.MaterielCode;
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)
} else {
this.sizeOption = [];
this.AddPlanForm.MaterielId = "";
this.AddPlanForm.MaterielName = "";
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
}
},
//获取号型的名字和ID
async getIDAndName(val) {
if (val !== "") {
var obj = {};
obj = this.sizeOption.find(function (item) {
return item.ID === val;
});
this.AddPlanForm.EqSizeId = obj.ID;
this.AddPlanForm.EqSizeName = obj.EqSizeName;
this.AddPlanForm.EqSizeCode = obj.Code;
} else {
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
}
},
///提交表单
async submitForm() {
// console.log("length",)
if (this.ruleForm.BorrowList.length===0) {
return this.$message.warning("请添加装备");
}
if (!this.ruleForm.submitUsrID) {
return this.$message.warning("请选择借用人员");
}
this.ruleForm.IsHaoCai = 1;
this.ruleForm.borrowType=1;
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);
}
},
closeForm() {
this.resetForm();
},
//添加装备
addEquipment() {
if(this.AddPlanForm.MaterielId==="")
{
return this.$message.warning("请选择物料添加");
}
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.ruleForm.BorrowList.find(function (item) {
return item.MaterielID === plan.MaterielID;
});
console.log("添加物资", obj);
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);
},
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
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);
},
},
};
</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>
<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/i_3盘盒借用.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(1)"
>查询</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-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addIssued()"
>借用下发</el-button
>
<el-dialog :visible.sync="addIssuedDialogVisible" title="请选择要创建的维修下发单据类型" width="500px" align="center">
<div slot="footer" class="dialog-footer" align="center">
<el-button
type="warning"
icon="el-icon-box"
@click="addRecive(0)"
>借用下发(不贴标)</el-button
>
<el-button
type="success"
icon="el-icon-box"
@click="addRecive(1)"
>借用下发(贴标)</el-button
>
<!-- <el-button type="primary" @click="clickOrderType">确认</el-button> -->
</div>
</el-dialog>
</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="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="ExamineStateName"
label="审核状态"
align="center"
/>
<el-table-column prop="LyTime" label="借用时间" align="center" />
<el-table-column
prop="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column
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="[-3].includes(scope.row.SubmitState)"
ghost
round
size="small"
@click="editStagingForm(scope.row)"
>编辑</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
>
</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-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.submitUserName"
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>
<el-divider style="margin-bottom: 35px"></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.MaterielNam"
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>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取 消</el-button>
<!-- <el-button type="warning" @click="stagingForm(1)">暂存</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="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.submitUserName"
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>
<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>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="NHCaddVisible = false">取 消</el-button>
<!-- <el-button type="warning" @click="stagingForm(0)">暂存</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,
departId: '',
addIssuedDialogVisible:false,
searchData: {
Page: 1,
Rows: 10,
Sort: "ID",
Order: "ESC",
DepartName: "",
UserName: "",
IsAdmin: 1,
SubmitState: "0",
SubmitUserName: "",
borrowType: 1,
},
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: 1,
IsHaoCai: 0,
isDraft:false,
submitUsrID: "",
submitUserName: "",
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielID: "",
EqSizeId: "",
EqSizeName: "",
LyCount: 1,
},
],
},
NHCruleForm: {
ID: 0,
PlanName: "",
PlanState: 0,
borrowType: 1,
IsHaoCai: 1,
submitUsrID: "",
submitUserName: "",
isDraft:false,
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: "",
EquipmentId: '',
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;
this.ruleForm.submitUserName='';
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 stagingForm(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=1;
this.NHCruleForm.isDraft=true;
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=1;
this.ruleForm.isDraft=true;
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 editStagingForm(row) {
console.log(row.IsHaoCai);
// 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.NHCruleForm = 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.Visible = true;
// var url = "api/Borrow/" + 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;
// }
if (row.IsHaoCai === 0) {
const borrowUrl = "/api/Department/" + 0;
const { data: resdepartment } = await this.$axios.get(borrowUrl);
this.departOptions = resdepartment;
//耗材1
this.title = "借用下发(不贴标物资)";
this.addVisible = true;
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
this.departId = res.DeparId
console.log(this.departId)
} //非耗材0
else {
this.title = "借用下发(贴标物资)";
this.NHCaddVisible = true;
//this.NHCruleForm.BorrowList = [];
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
this.ruleForm.BorrowList = JSON.parse(JSON.stringify(res));
console.log('tb'+this.ruleForm)
}
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;
},
///提交表单
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=1;
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;
this.addIssuedDialogVisible =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=1;
const borrowUrl = "/api/Borrow/AdminCreateBorrow";
const { data: res } = await this.$axios.post(borrowUrl, this.ruleForm);
this.searchData.SubmitState="1";
this.getQueuData();
this.addVisible = false;
this.addIssuedDialogVisible =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 = "";
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.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 &&
item.MaterielCode === plan.MaterielCode
);
});
console.log("obj", obj);
if (obj === undefined) {
this.ruleForm.BorrowList.push(plan);
} else {
this.$message.error("已经存在该物资");
}
// obj = this.ruleForm.BorrowList.find(function (item) {
// return item.MaterielId === plan.MaterielId;
// });
// 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;
}
},
//下发借用
addIssued(){
this.addIssuedDialogVisible = true;
},
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.warning("已取消"+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(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
this.searchData.borrowType = 1;
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>
<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(1)"
>查询</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-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addFix()"
>维修下发</el-button
>
<el-dialog :visible.sync="addIssuedDialogVisible" title="请选择要创建的维修下发单据类型" width="500px" align="center">
<div slot="footer" class="dialog-footer" align="center">
<el-button
type="warning"
icon="el-icon-setting"
@click="addReciveFix(0)"
>维修下发(不贴标)</el-button
>
<el-button
type="success"
icon="el-icon-setting"
@click="addReciveFix(1)"
>维修下发(贴标)</el-button
>
<!-- <el-button type="primary" @click="clickOrderType">确认</el-button> -->
</div>
</el-dialog>
</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="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="ExamineStateName"
label="审核状态"
align="center"
/>
<el-table-column prop="LyTime" label="维修时间" align="center" />
<el-table-column
prop="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column
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-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.submitUserName"
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>
<el-divider style="margin-bottom: 35px"></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>
</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="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.submitUserName"
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>
<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>
</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,
addIssuedDialogVisible: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;
this.ruleForm.submitUserName='';
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.resetForm();
this.NHCaddVisible = false;
this.addIssuedDialogVisible =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.resetForm();
this.addVisible = false;
this.addIssuedDialogVisible = 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 = "";
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.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.MaterielId === plan.MaterielId;
});
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;
}
},
//下发维修
addFix(){
this.addIssuedDialogVisible = true;
},
async addReciveFix(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.warning("已取消"+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(arg) {
if(arg) {
this.searchData.Page = 1
}
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>
......@@ -78,17 +78,17 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
<!-- <el-button
type="primary"
icon="el-icon-plus"
style="height: 40px; margin-left: 10px"
class="funcButton"
@click="addRecive(0)"
>维修下发(贴标)</el-button
>维修下发(贴标)</el-button
>
<el-button
type="primary"
......@@ -96,8 +96,34 @@
style="height: 40px"
class="funcButton"
@click="addRecive(1)"
>维修下发(已贴标)</el-button
>维修下发(贴标)</el-button
> -->
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addFix()"
>维修下发</el-button
>
<el-dialog :visible.sync="addIssuedDialogVisible" title="请选择要创建的维修下发单据类型" width="500px" align="center">
<div slot="footer" class="dialog-footer" align="center">
<el-button
type="warning"
icon="el-icon-setting"
@click="addReciveFix(0)"
>维修下发(不贴标)</el-button
>
<el-button
type="success"
icon="el-icon-setting"
@click="addReciveFix(1)"
>维修下发(贴标)</el-button
>
<!-- <el-button type="primary" @click="clickOrderType">确认</el-button> -->
</div>
</el-dialog>
</el-form>
<!-- 列表区域 -->
......@@ -119,12 +145,6 @@
align="center"
/>
<el-table-column
prop="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column
prop="IsHaoCai"
label="单据类型"
:formatter="stateFormat"
......@@ -140,15 +160,21 @@
align="center"
/>
<el-table-column prop="ExamineTime" label="审核时间" align="center" />
<el-table-column
prop="ExamineStateName"
label="审核状态"
align="center"
/>
<el-table-column prop="LyTime" label="维修时间" align="center" />
<el-table-column
prop="SubmitStateName"
label="状 态"
prop="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column
fixed="right"
label="操作"
align="center"
>
......@@ -380,148 +406,21 @@
>
</div>
</el-dialog>
<!-- 新增/编辑 耗材 -->
<!-- 引入新增/编辑 耗材(不贴标)组件 -->
<repairGetNTBForm ref="repairGetNTBForm" />
<!-- 新增/编辑 非耗材-->
<el-dialog
width="70%"
:close-on-click-modal="false"
:title="title"
:visible.sync="addVisible"
: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, '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"
:model="NHCruleForm"
ref="NHCruleForm"
label-position="left"
style="margin-top: 30px"
>
......@@ -542,9 +441,9 @@
>人员选择
<el-select
class="diaD"
v-model="ruleForm.userID"
v-model="ruleForm.submitUserName"
placeholder="请选择人员"
@change="policeSelect"
@change="NHCpoliceSelect"
>
<el-option
v-for="item in policeOptions"
......@@ -564,29 +463,14 @@
<el-input
type="textarea"
:autosize="{ minRows: 6, maxRows: 50 }"
v-model="ruleForm.Remarks"
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="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-divider></el-divider>
<el-form
:model="ruleForm"
ref="ruleForm"
......@@ -727,58 +611,6 @@
<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>
......@@ -806,11 +638,13 @@
<script>
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import repairGetNTBForm from './repairGetNTBForm';
export default {
components: { Treeselect },
components: { Treeselect, repairGetNTBForm},
data() {
return {
loading: false,
addIssuedDialogVisible:false,
searchData: {
Page: 1,
Rows: 10,
......@@ -1103,6 +937,7 @@ export default {
this.AddPlanForm.parentName = node.DepartName;
this.AddPlanForm.parentId = node.ID;
this.searchUserData.DeparId = node.ID;
this.ruleForm.submitUserName='';
const { data: res } = await this.$axios.get("api/User", {
params: this.searchUserData,
});
......@@ -1183,7 +1018,9 @@ export default {
this.searchData.SubmitState="1";
this.getQueuData();
this.resetForm();
this.NHCaddVisible = false;
this.addIssuedDialogVisible =false;
if (res.Success !== true) return this.$message.error(res.Remark);
else
{
......@@ -1204,7 +1041,9 @@ export default {
const { data: res } = await this.$axios.post(borrowUrl, this.ruleForm);
this.searchData.SubmitState="1";
this.getQueuData();
this.resetForm();
this.addVisible = false;
this.addIssuedDialogVisible = false;
if (res.Success !== true) return this.$message.error(res.Remark);
else
{
......@@ -1261,8 +1100,11 @@ export default {
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", {
......@@ -1331,12 +1173,12 @@ export default {
};
console.log("添加物资", plan);
obj = this.ruleForm.BorrowList.find(function (item) {
return item.EqSizeId === plan.EqSizeId;
return item.MaterielId === plan.MaterielId;
});
if (obj === undefined) {
this.ruleForm.BorrowList.push(plan);
// this.AddPlanForm.EqSizeId="";
// this.AddPlanForm.EqSizeName="";
this.AddPlanForm.EqSizeId="";
this.AddPlanForm.EqSizeName="";
} else {
this.$message.error("已经存在该物资");
}
......@@ -1350,9 +1192,9 @@ export default {
},
stateFormat(row) {
if (row.IsHaoCai === 0) {
return "贴标";
return "贴标";
} else if(row.IsHaoCai===1) {
return "贴标";
return "贴标";
}
else
{
......@@ -1375,16 +1217,22 @@ export default {
}
},
//下发维修
async addRecive(row) {
addFix(){
this.addIssuedDialogVisible = true;
},
async addReciveFix(row) {
this.addIssuedDialogVisible = false;
console.log(row);
if (row === 0) {
//耗材0
this.title = "维修下发(未贴标物资)";
this.addVisible = true;
this.ruleForm.BorrowList = [];
console.log('btb');
const _this = this.$refs.repairGetNTBForm
_this.editVisible = true;
_this.addRecive()
} //非耗材1
else {
this.title = "维修下发(贴标物资)";
this.title = "维修下发(贴标物资)";
this.NHCaddVisible = true;
this.NHCruleForm.BorrowList = [];
}
......@@ -1431,7 +1279,7 @@ export default {
}
})
.catch((e) => {
this.$message.error(""+stateName+"操作");
this.$message.warning("已取消"+stateName+"操作");
});
},
///人员选择
......@@ -1498,7 +1346,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;
this.searchData.borrowType = 2;
const { data: res } = await this.$axios.get("api/Borrow", {
......
<template>
<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-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.submitUserName"
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>
<el-divider style="margin-bottom: 35px"></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.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="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>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取 消</el-button>
<!-- <el-button type="warning" @click="stagingForm(1)">暂存</el-button> -->
<el-button type="primary" @click="submitForm(1)">提交</el-button>
</span>
</el-dialog>
</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: "",
},
AddPlanForm: {
parentName: "",
parentId: "",
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
},
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: 0,
IsHaoCai: 0,
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.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,
},
],
});
},
searchMaterielData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ESC",
MaterielId: "",
},
auditbutton: false,
editForm: {
ID: "",
SubmitState: 0,
exameReason: "",
},
addVisible: false,
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.getQueuData();
},
methods: {
//下发领用
async addRecive() {
this.title = "维修下发(不贴标物资)";
this.addVisible = true;
this.ruleForm.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;
console.log("rule", this.ruleForm);
this.classOption = resclass.Rows;
},
// 获取当前选中部门的名称
async selectDepart(node) {
console.log(node);
this.AddPlanForm.parentName = node.DepartName;
this.AddPlanForm.parentId = node.ID;
this.searchUserData.DeparId = node.ID;
this.ruleForm.submitUserName='';
const { data: res } = await this.$axios.get("api/User", {
params: this.searchUserData,
});
this.policeOptions = res.Rows;
},
///人员选择
policeSelect(row) {
var obj = {};
obj = this.policeOptions.find(function (item) {
return item.ID === row;
});
console.log(obj)
this.ruleForm.submitUsrID = row;
this.ruleForm.submitUserName = row;
},
///获取类别的ID和内容
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;
} else {
this.sizeOption = [];
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
}
},
//物料选择后
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.MaterielCode = obj.MaterielCode;
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)
} else {
this.sizeOption = [];
this.AddPlanForm.MaterielId = "";
this.AddPlanForm.MaterielName = "";
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
}
},
//获取号型的名字和ID
async getIDAndName(val) {
if (val !== "") {
var obj = {};
obj = this.sizeOption.find(function (item) {
return item.ID === val;
});
this.AddPlanForm.EqSizeId = obj.ID;
this.AddPlanForm.EqSizeName = obj.EqSizeName;
this.AddPlanForm.EqSizeCode = obj.Code;
} else {
this.AddPlanForm.EqSizeId = "";
this.AddPlanForm.EqSizeName = "";
}
},
///提交表单
async submitForm() {
// console.log("length",)
if (this.ruleForm.BorrowList.length===0) {
return this.$message.warning("请添加装备");
}
if (!this.ruleForm.submitUsrID) {
return this.$message.warning("请选择维修人员");
}
this.ruleForm.IsHaoCai = 1;
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);
}
},
closeForm() {
this.resetForm();
},
//添加装备
addEquipment() {
if(this.AddPlanForm.MaterielId==="")
{
return this.$message.warning("请选择物料添加");
}
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.ruleForm.BorrowList.find(function (item) {
return item.MaterielID === plan.MaterielID;
});
console.log("添加物资", obj);
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);
},
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
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);
},
},
};
</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>
......@@ -69,7 +69,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
......@@ -201,7 +201,10 @@ export default {
this.imgurl =window._CONFIG['dlURL'] + "/"+row.ImagePath;
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading=true;
const { data: res } = await this.$axios.get('api/ReturnLog', {params: this.searchData});
this.total = res.Total;
......
......@@ -17,7 +17,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
>
......
......@@ -17,7 +17,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
>
......@@ -78,7 +78,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
......@@ -120,15 +120,21 @@
align="center"
/>
<el-table-column prop="ExamineTime" label="审核时间" align="center" />
<el-table-column
prop="ExamineStateName"
label="审核状态"
align="center"
/>
<el-table-column prop="LyTime" label="领用时间" align="center" />
<el-table-column
prop="SubmitStateName"
label="状 态"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column
prop="SubmitState"
fixed="right"
label="操作"
width="100"
>
......@@ -323,6 +329,58 @@
<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.submitUserName"
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>
<el-divider style="margin-bottom: 35px"></el-divider>
<el-form
:model="ruleForm"
ref="ruleForm"
label-width="100px"
style="margin-top: 10px; margin-bottom: 35px"
>
......@@ -448,58 +506,7 @@
<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>
......@@ -767,6 +774,7 @@ export default {
this.AddPlanForm.parentName = node.DepartName;
this.AddPlanForm.parentId = node.ID;
this.searchUserData.DeparId = node.ID;
this.ruleForm.submitUserName='';
const { data: res } = await this.$axios.get("api/User", {
params: this.searchUserData,
});
......@@ -895,10 +903,20 @@ export default {
deleteEquipment(row) {
this.ruleForm.BorrowList.splice(row, 1);
},
SubmitFormat(row) {
if (row.SubmitStateName === '同意申请') {
return "待领取";
}else if(row.SubmitStateName==='等待审批') {
return "待审批";
}
else
{
return row.SubmitStateName;
}
},
//下发领用
async addRecive() {
this.title = "领用下发(贴标物资)";
this.title = "领用下发(贴标物资)";
this.addVisible = true;
this.ruleForm.BorrowList = [];
//
......@@ -970,8 +988,10 @@ export default {
if(this.$route.query.options!=undefined)
{ this.searchData.SubmitState=this.$route.query.options;}
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/Borrow", {
params: this.searchData,
......
......@@ -2,9 +2,10 @@
<template>
<div class="body" style="margin-right: 10px;">
<div class="title_box">
<!-- 顶部卡片 -->
<el-card
style="height: 167px; position: relative;
margin-bottom: 20px;"
style="height: 155px; position: relative;
margin-bottom: 12px;"
>
<el-row
:gutter="40"
......@@ -37,9 +38,9 @@
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData(1)">
<div class="card-panel-icon-wrapper icon-message">
<div class="card-panel-icon-wrapper icon-gongg">
<img
src="../assets/images/公共服务.png"
src="../assets/images/公共暂存处.png"
class="logo"
alt="logo"
/>
......@@ -56,29 +57,6 @@
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div
class="card-panel"
@click="handleSetLineChartData(2)"
>
<div class="card-panel-icon-wrapper icon-money">
<img
src="../assets/images/警用装备.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">单警装备</div>
<count-to
:start-val="0"
:end-val="eqCount.h_EqPrivateCount"
:duration="3200"
class="card-panel-num"
/>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="gotoBorrowEq('2')">
<div class="card-panel-icon-wrapper icon-return">
<img
......@@ -98,7 +76,7 @@
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<!-- <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div
class="card-panel"
@click="gotoBorrowEq('0')"
......@@ -140,54 +118,252 @@
/>
</div>
</div>
</el-col> -->
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div
class="card-panel"
@click="handleSetBFData('2')"
>
<div class="card-panel-icon-wrapper icon-weixiu">
<img
src="../assets/images/维修2.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">维修数量</div>
<count-to
:start-val="0"
:end-val="eqCount.h_WXCount"
:duration="3200"
class="card-panel-num"
/>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div
class="card-panel"
@click="handleSetBFData('3')"
>
<div class="card-panel-icon-wrapper icon-baofei">
<img
src="../assets/images/报废.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">报废数量</div>
<count-to
:start-val="0"
:end-val="eqCount.h_BfedCount"
:duration="3200"
class="card-panel-num"
/>
</div>
</div>
</el-col>
</el-row>
</el-card>
<el-row :gutter="20">
<!-- 折线图、消息块 -->
<el-row :gutter="20" style="position: relative; top: -5px">
<el-col :span="16">
<el-card style=" padding: 10px;">
<span
style="
font-size: 28px;
font-weight: 800;
text-align: left;
display: block;
color: rgba(15, 56, 84, 0.58);
"
>装备近期使用频率(近一周)</span
>
<div id="lineChart" class="chartC" />
</el-card>
</el-col>
<el-col :span="8">
<el-card>
<el-card style=" padding: 10px;">
<span
style="
font-size: 28px;
font-weight: 800;
text-align: left;
display: block;
color: #759393;
color: rgba(15, 56, 84, 0.58);
"
>装备状态比例</span
>装备消息提醒</span
>
<el-row :gutter="20" style="position: relative; top: 20px; text-align:center;">
<el-col :span="8" >
<div class="grid-content" style="cursor:pointer; background-color:rgb(253, 253, 253);box-shadow: rgb(203 198 198 / 32%) 10px 10px 30px;height: 125px; width:130px; padding: 1%; margin-bottom: 10px; ">
<el-badge :value="outinExceptionCount" class="item" >
<div
class="card-panel"
@click="gotoOutInException('11')"
>
<div class="card-panel-icon-wrapper icon-people">
<img
src="../assets/images/门禁报警.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">异常出库</div>
</div>
</div>
</el-badge>
</div>
</el-col>
<el-col :span="8" >
<div class="grid-content" style="cursor:pointer; background-color:rgb(253, 253, 253);box-shadow: rgb(203 198 198 / 32%) 10px 10px 30px;height: 125px; width:130px; padding: 1%;margin-bottom: 10px; ">
<el-badge :value="eqCount.h_ByCount" class="item" >
<div
class="card-panel"
@click="gotoBaoYang()"
>
<div id="pieChart" class="chartC" />
<div class="card-panel-icon-wrapper icon-people">
<img
src="../assets/images/保养.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">装备保养</div>
</div>
</div>
</el-badge>
</div>
</el-col>
<el-col :span="8" >
<div class="grid-content" style="cursor:pointer; background-color:rgb(253, 253, 253);box-shadow: rgb(203 198 198 / 32%) 10px 10px 30px;height: 125px; width:130px; padding: 1%; margin-bottom: 10px; ">
<el-badge :value="eqCount.h_Bf10Count" class="item" >
<div
class="card-panel"
@click="gotoLJBaoFei()"
>
<div class="card-panel-icon-wrapper icon-people">
<img
src="../assets/images/超时未报.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">即将报废</div>
</div>
</div>
</el-badge >
</div>
</el-col>
<el-col :span="8">
<div class="grid-content" style="cursor:pointer; background-color:rgb(253, 253, 253);box-shadow: rgb(203 198 198 / 32%) 10px 10px 30px;height: 125px; width:130px; padding: 1%;margin-bottom: 10px;" >
<el-badge :value="eqCount.h_LYWaitToExamined" class="item" >
<div
class="card-panel"
@click="gotoGetEq('0')"
>
<div class="card-panel-icon-wrapper icon-people">
<img
src="../assets/images/领待审批.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">领用待审批</div>
</div>
</div>
</el-badge>
</div>
</el-col>
<el-col :span="8" >
<div class="grid-content" style="cursor:pointer; background-color:rgb(253, 253, 253);box-shadow: rgb(203 198 198 / 32%) 10px 10px 30px;height: 125px; width:130px; padding: 1%;margin-bottom: 10px;">
<el-badge :value="eqCount.h_JYWaitToExamined" class="item" >
<div
class="card-panel"
@click="gotoBorrowEq('0')"
>
<div class="card-panel-icon-wrapper icon-people">
<img
src="../assets/images/借待审批.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">借用待审批</div>
</div>
</div>
</el-badge>
</div>
</el-col>
<el-col :span="8" >
<div class="grid-content" style="cursor:pointer; background-color:rgb(253, 253, 253);box-shadow: rgb(203 198 198 / 32%) 10px 10px 30px;height: 125px; width:130px; padding: 1%;margin-bottom: 10px;">
<el-badge :value="wXWaitToExaminedCount" class="item" >
<div
class="card-panel"
@click="gotoWXEq('0')"
>
<div class="card-panel-icon-wrapper icon-people">
<img
src="../assets/images/维修计划.png"
class="logo"
alt="logo"
/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">维修待审批</div>
</div>
</div>
</el-badge>
</div>
</el-col>
</el-row>
</el-card>
</el-col>
</el-row>
<!-- 饼图、柱状图 -->
<el-row :gutter="20" style="position: relative; top: 2px">
<el-col :span="16">
<el-card>
<el-card style=" padding: 10px;">
<span
style="
font-size: 28px;
font-weight: 800;
text-align: left;
display: block;
color: #759393;
color: rgba(15, 56, 84, 0.58);
"
>装备使用频率(使用量)</span
>
<div id="barChart" class="chartC" />
</el-card>
</el-col>
</el-row>
<el-card style="position: relative; top: 20px">
<el-col :span="8">
<el-card >
<span
style="
font-size: 28px;
font-weight: 800;
text-align: left;
display: block;
color: #759393;
color: rgba(15, 56, 84, 0.58);
"
>装备近期使用频率(近一周)</span
>装备状态比例</span
>
<div id="lineChart" class="chartC" />
<div id="pieChart" class="chartC" style="height:280;width: 520px;"/>
</el-card>
</el-col>
</el-row>
</div>
</div>
</template>
......@@ -206,20 +382,59 @@ export default {
pieData: [],
linedata: [],
eqCount: {},
Rows:'',
outinExceptionCount:0,
wXWaitToExaminedCount:0,
Total: 0,
searchWXData: {
Page: 1,
Rows: 10,
Sort: "ID",
Order: "ESC",
DepartName: "",
UserName: "",
IsAdmin: 1,
SubmitState: "0",
SubmitUserName: "",
borrowType: 2,
},
// StateType:2,
};
},
//初始加载
mounted() {
setTimeout(() => {}, 500);
this.InitData();
this.initBar();
this.initPie();
this.initBar();
this.initLine();
// setTimeout(() => {
// this.initPie();
// }, 1500);
},
created() {
this.InitData();
this.queryOutInException();
this.queryWXWaitToExamined();
},
created() {},
methods: {
//异常出库数
async queryOutInException(){
const { data: res } = await this.$axios.get(
"api/Borrow/GetInventoryLog",
{ params: {Type:this.Type=11,IsReturned:this.IsReturned=false} }
);
this.outinExceptionCount =res.Total;
//console.log("ycck"+this.outinExceptionCount)
},
// 维修待审批数
async queryWXWaitToExamined(){
this.searchWXData.borrowType = 2;
const { data: res } = await this.$axios.get("api/Borrow", {
// params: { Order:this.Order= "ESC", Sort:this.Sort="ID", Type:this.borrowType = 2, IsAdmin:this.IsAdmin=1, SubmitState: this.SubmitState= 0}
params:this.searchWXData,
});
this.wXWaitToExaminedCount = res.Total;
},
//标题图标
handleSetLineChartData( type) {
......@@ -274,6 +489,37 @@ export default {
},
});
},
//跳去维修待审批页面
gotoWXEq(type) {
this.$router.push({
name: "repairGet",
query: {
options: type,
},
});
},
//跳去异常出库页面
gotoOutInException(type) {
this.$router.push({
name: "outinLog",
query: { Type: type},
});
},
//跳去保养页面
gotoBaoYang() {
this.$router.push({
name: "equMaintenanceReminder",
query: { activeName: '0',IsLjBaoFeiDay:"",IsLjBaoYang:"1"},
});
},
//跳去即将报废页面
gotoLJBaoFei(){
this.$router.push({
name: "equMaintenanceReminder",
query: { activeName: '1',baoFeiStatus:"即将报废",IsLjBaoFeiDay:"10",IsLjBaoYang:""},
});
},
async InitData() {
const { data: eqclass } = await this.$axios.get("api/ChartStatistics");
this.eqCount = eqclass;
......@@ -346,7 +592,7 @@ export default {
const { data: Pieclass } = await this.$axios.get(
"api/ChartStatistics/GetPie"
);
//let a = [{"name":"在库","value":1021,"bfb":"1.00"},{"name":"出库","value":2,"bfb":"0.00"},{"name":"维修","value":0,"bfb":"0.00"},{"name":"报废","value":0,"bfb":"0.00"}];
Pieclass.forEach((item) => {
this.pieData.push({
name: item.name,
......@@ -357,7 +603,7 @@ export default {
const chart = new Chart({
container: "pieChart",
autoFit: true,
height: 220,
height: 235,
width: 200,
});
......@@ -401,7 +647,7 @@ export default {
const chart = new Chart({
container: "barChart",
autoFit: true,
height: 220,
height: 215,
});
chart.data(eqclass.Rows);
......@@ -432,10 +678,9 @@ export default {
.panel-group {
.card-panel-col {
width: 16%;
width: 19%;
}
.card-panel {
top: 12px;
......@@ -445,9 +690,13 @@ export default {
position: relative;
overflow: hidden;
color: #666;
background: #eeeeee;
box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
border-color: rgba(0, 0, 0, 0.05);
// background: #eeeeee;
//background: rgba(15, 56, 84, 0.08);
//box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
box-shadow: 6px 6px 20px rgba(0, 0, 0,0.2);
// box-shadow: 10px 10px 20px rgb(126 121 121);
border-color : rgba(0, 0, 0, 0.05);
&:hover {
.card-panel-icon-wrapper {
......@@ -455,28 +704,32 @@ export default {
}
.icon-people {
background: #40c9c6;
background: rgba(1, 83, 177, 0.274);
}
.icon-message {
background: beige;
.icon-gongg {
background: rgba(20, 202, 44, 0.274);
}
.icon-money {
background: #f4516c;
.icon-weixiu {
background: rgba(18, 94, 41, 0.274);
}
.icon-baofei {
background: rgba(230, 44, 31, 0.274);
}
.icon-return {
background: #34bfa3;
background: rgba(230, 194, 31, 0.274);
}
.icon-fix {
background: #ecee8a;
background: rgba(31, 124, 230, 0.274);
}
.icon-get {
background: #dfab5e;
background: rgba(236, 211, 128, 0.274);
}
}
.card-panel-icon-wrapper {
float: left;
margin: 0px 0px 0px 0px;
......@@ -511,6 +764,7 @@ export default {
}
.chartC {
margin-top: 50px;
//height: 200px;
}
@media (max-width: 550px) {
.card-panel-description {
......
......@@ -4,6 +4,7 @@
<el-header>
<!-- logo区域 -->
<div class="logo" @click="goHome()">
<!-- <img src="../assets/logo_xtj.png" alt="logo" /> -->
<img src="../assets/logo_xtj.png" alt="logo" />
<span>巡特警装备管理系统</span>
</div>
......@@ -142,8 +143,8 @@ export default {
// 头部样式
.el-header {
// background: linear-gradient(to bottom, #344534, #284527 20%, #344534 65%, #284527 80%, #344534) !important;
background: radial-gradient(ellipse at center, #0f3854 0%, #000000 80%);
background: #04436f no-repeat 100% 100%;
background: radial-gradient(ellipse at center, #0f3854 20%, #000000 160%);
// background: #04436f no-repeat 100% 100%;
// background-size: 20% 100%;
background-position: center;
display: flex;
......
......@@ -49,7 +49,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
</el-form>
......@@ -266,7 +266,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/MenJingLog", {
params: this.searchData,
......
<template>
<el-dialog
width="80%"
:close-on-click-modal="false"
title="异常出库处理"
:visible.sync="outInExVisible"
@close="closeForm('ruleForm')"
>
<el-form
:model="outInExForm"
ref="ruleSet"
label-width="100px"
style="margin-top: 10px"
>
<!-- class="inputClass" -->
<el-row :gutter="90">
<el-col :span="10">
<el-form-item style="padding-left: 32px" label="部门选择">
<treeselect
style="width: 205px; float: left; margin-left: 1px"
noOptionsText="暂无数据"
:options="departOptions"
placeholder="请选择上级部门"
:normalizer="normalizer"
@select="selectDepart"
/>
</el-form-item>
<el-form-item
style="padding-left: 32px"
label="人员选择"
>
<el-select
style=" float: left; margin-left: 1px"
v-model="outInExForm.submitUsrID"
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="10">
<el-form-item label="处理原因" class="labelClass">
<el-input
class="labelClassT"
type="textarea"
:rows="4"
v-model="outInExForm.submitReason"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 主表 -->
<el-table
v-loading="loading"
:data="borrowData"
stripe
style="width: 100%"
size="small"
border
highlight-current-row
@selection-change="handleSelectionChange"
>
<el-table-column prop="EPC" v-if="false" />
<el-table-column prop="ID" v-if="false" />
<el-table-column prop="PhotoUrl" v-if="false" />
<el-table-column
prop="MaterielName"
label="物料名称"
width="250"
align="center"
/>
<el-table-column prop="EquName" label="装备名称" width="250" align="center" />
<el-table-column prop="EqSizeName" label="号型名称" width="200" align="center" />
<el-table-column prop="LocationName" label="储位名称" width="200" align="center" />
<el-table-column prop="UserName" label="操作人员" width="100" align="center" />
<el-table-column
prop="CreateTime"
label="出入库时间"
sortable
width="250"
align="center"
/>
<el-table-column label="照片查看" align="center">
<template slot-scope="scope">
<el-button
v-if="scope.row.PhotoUrl !== null"
@click="getPhotoInfo(scope.row)"
type="primary"
size="mini"
>预览</el-button
>
</template>
</el-table-column>
<el-table-column
type="selection"
width="66"
align="center"
>
</el-table-column>
</el-table>
<!-- 预览照片 -->
<el-dialog title="照片查看" :visible.sync="photoVisible" width="900px" append-to-body>
<img
:src="imgurl"
class="picOutIn"
width="855px"
height="512px"
alt=""
/>
<div slot="footer" class="dialog-footer">
<el-button @click="photoVisible = 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>
<span slot="footer" class="dialog-footer">
<el-button @click="outInExVisible = false">取 消</el-button>
<el-button type="primary" @click="submitOutInExForm()"
>提交</el-button
>
</span>
</el-dialog>
</template>
<script>
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { Treeselect},
data() {
return {
loading: false,
input: "",
form: {},
DepartName:"",
departOptions: [],
policeOptions:[],
tableData: [],
detailData: [],
photoVisible:false,
imgurl: [],
borrowData: [],
equipmentInventoryLogList:[],
outInExVisible: false,
formLabelWidth: "120px",
// 总条数
total: 0,
ruleForm: {
ID: 0,
PlanName: "",
PlanState: 0,
borrowType: 1,
IsHaoCai: 0,
isDraft:false,
submitUsrID: "",
submitUserName: "",
BorrowList: [
{
MainClass: "",
MaterielCode: "",
MaterielName: "",
MaterielID: "",
EqSizeId: "",
EqSizeName: "",
LyCount: 1,
},
],
},
AddPlanForm: {
parentName: "",
parentId: "",
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EquipmentId: "",
EquipmentName: "",
},
searchData: {
Page: 1,
Rows: 10,
Sort: "ID",
Order: "DESC",
Type:11,
EquName:"",
OrderBy: "CreateTime",
IsReturned:false,
},
searchUserData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
DeparId: "",
},
outInExForm: {
ID: 0,
Remark: "",
submitUsrID:'',
submitUserName:'',
submitReason:'',
equipmentInventoryLogList:{
id: "",
createTime: "",
type: "",
userId: "",
userName: "",
epc: "",
equId: "",
equName: "",
materielId: "",
materielName: "",
eqSizeId: "",
eqSizeName: "",
photoUrl: "",
locationName: "",
isReturned: true
}
},
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() {
},
methods: {
// async InitQuery()
// {
// if(this.$route.query.options!=undefined)
// { this.searchData.SubmitState=this.$route.query.options;}
// },
//查询条件添加回车键
onEnterPress() {
this.getQueuData();
},
// 获取当前选中部门的名称
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;
},
///人员选择
policeSelect(row) {
var obj = {};
obj = this.policeOptions.find(function (item) {
return item.ID === row;
});
console.log(obj)
this.outInExForm.submitUsrID =obj.ID;
this.outInExForm.submitUserName =obj.UserName;
},
///获取详细信息
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get(
"api/Borrow/GetInventoryLog",
{ params: this.searchData }
);
const depart = "/api/Department/" + 0;
const { data: resdepartment } = await this.$axios.get(depart);
this.departOptions = resdepartment;
this.total = res.Total;
this.borrowData = res.Rows;
this.timer = setTimeout(() => {
//设置延迟执行
this.loading = false;
}, 300);
},
//查看照片信息
async getPhotoInfo(row) {
this.photoVisible = true;
this.imgurl = window._CONFIG["dlURL"] + "/" + row.PhotoUrl;
},
//选择行
handleSelectionChange(val) {
//this.multipleSelection = val;
this.outInExForm.equipmentInventoryLogList=val;
console.log(this.outInExForm.equipmentInventoryLogList)
},
//提交异常出库
async submitOutInExForm(){
console.log('oooo')
if(this.outInExForm.submitUsrID==''|| this.outInExForm.submitUsrID==undefined){
return this.$message.warning('请选择对应的操作人员');
}
if(this.outInExForm.equipmentInventoryLogList.epc===''){
return this.$message.warning('请勾选对应要处理的异常出库装备');
}
const { data: res } = await this.$axios.post(
"/api/Borrow/AdminErrorOutConvertBorrow",
this.outInExForm
);
//this.getQueuData();
this.outInExVisible=false;
if (res.Success !== true) return this.$message.error(res.Remark);
else
{
return this.$message.success('处理成功');
}
},
// 分页功能
// 每页显示条数发生改变时
handleSizeChange(val) {
this.searchData.Rows = val;
this.getQueuData();
},
// 当前页数发生改变时
handleCurrentChange(val) {
this.searchData.Page = val;
console.log(val);
this.getQueuData();
},
//关闭窗口
closeForm() {
//this.resetForm();
this.outInExVisible = false;
},
},
computed: {},
};
</script>
\ No newline at end of file
<template>
<el-dialog title="照片查看" :visible.sync="picVisible" width="900px">
<img
:src="imgurl"
class="picOutIn"
width="855px"
height="512px"
alt=""
/>
<div slot="footer" class="dialog-footer">
<el-button @click="picVisible = false">关 闭</el-button>
</div>
</el-dialog>
</template>
<script>
import outinExceptionPhto from './outinExceptionPhto'
export default {
components: { outinExceptionPhto},
data() {
return {
loading: false,
input: "",
form: {},
DepartName:"",
departOptions: [],
policeOptions:[],
tableData: [],
detailData: [],
picVisible:false,
imgurl: [],
borrowData: [],
outInExVisible: false,
};
},
created() {
},
methods: {
//查看照片信息
async getDetailInfo(row) {
this.picVisible = true;
this.imgurl = window._CONFIG["dlURL"] + "/" + row.PhotoUrl;
},
//关闭窗口
closeForm() {
//this.resetForm();
this.outInExVisible = false;
},
},
computed: {},
};
</script>
\ No newline at end of file
......@@ -17,7 +17,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
>
......@@ -75,9 +75,17 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
type="danger"
icon="el-icon-document-remove"
style="height: 40px"
class="funcButton"
@click="exceptionHandling()"
>异常出库处理</el-button
>
</el-form>
<!-- 列表区域 -->
......@@ -96,23 +104,35 @@
<el-table-column prop="ID" v-if="false" />
<el-table-column prop="PhotoUrl" v-if="false" />
<el-table-column
prop="Type" :formatter="stateFormat" label="类型" width="120" align="center" />
<el-table-column
prop="MaterielName"
label="物料名称"
width="250"
align="center"
/>
<el-table-column prop="EqSizeName" label="号型名称" width="200" align="center" />
<el-table-column prop="EquName" label="装备名称" width="250" align="center" />
<el-table-column prop="UserName" label="出入库人员" width="100" align="center" />
<el-table-column prop="EqSizeName" label="号型名称" width="100" align="center" />
<el-table-column prop="LocationName" label="储位名称" width="100" align="center" />
<el-table-column prop="UserName" label="操作人员" width="100" align="center" />
<el-table-column
prop="CreateTime"
label="出入库时间"
width="250"
align="center"
/>
<el-table-column fixed="right" label="照片查看" align="center">
<el-table-column prop="Type" label="出入库类型" width="120" align="center" >
<template slot-scope="scope">
<el-tag v-if="scope.row.Type === 0" type="success">入库</el-tag>
<el-tag v-else-if="scope.row.Type === 1" type="warning">出库</el-tag>
<el-tag v-else-if="scope.row.Type === 11" type="danger">异常出库</el-tag>
</template>
</el-table-column>
<el-table-column prop="IsReturned" label="异常出库处理" width="100" align="center" >
<template slot-scope="slotp">
<el-tag v-if="slotp.row.IsReturned === true && slotp.row.Type === 11 " type="success">已归还</el-tag>
<el-tag v-else-if="slotp.row.Type === false " ></el-tag>
</template>
</el-table-column>
<el-table-column label="照片查看" align="center">
<template slot-scope="scope">
<el-button
v-if="scope.row.PhotoUrl !== null"
......@@ -223,6 +243,9 @@
</div>
</el-dialog>
<!-- 表单组件-引用异常出库页面 -->
<outinExceptionHandling ref="outinExceptionHandling" />
<!-- 分页功能 -->
<el-row type="flex" justify="center" align="middle">
<el-pagination
......@@ -242,7 +265,9 @@
<script>
import outinExceptionHandling from './outinExceptionHandling'
export default {
components: { outinExceptionHandling },
data() {
return {
loading: false,
......@@ -307,7 +332,8 @@ export default {
},
created() {
this.searchData.State = this.$route.query.State || this.searchData.State;
this.searchData.Type =
this.searchData.Type = this.$route.query.Type || this.searchData.Type;
this.getQueuData();
},
......@@ -317,8 +343,17 @@ export default {
this.picVisible = true;
this.imgurl = window._CONFIG["dlURL"] + "/" + row.PhotoUrl;
},
async InitQuery()
{
if(this.$route.query.options!=undefined)
{ this.searchData.Type=this.$route.query.options;}
},
///获取详细信息
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get(
"api/Borrow/GetInventoryLog",
......@@ -336,19 +371,27 @@ export default {
this.getQueuData();
},
stateFormat(row) {
if (row.Type === 0) {
return "入库";
} else if(row.Type===1) {
return "出库";
}
else if(row.Type===11) {
return "异常出库";
}
else
{
return "";
}
// stateFormat(row) {
// if (row.Type === 0) {
// return "入库";
// } else if(row.Type===1) {
// return "出库";
// }
// else if(row.Type===11) {
// return "异常出库";
// }
// else
// {
// return "";
// }
// },
exceptionHandling(){
const _this = this.$refs.outinExceptionHandling
_this.outInExVisible = true;
_this.getQueuData();
_this.selectDepart();
console.log('cl')
},
// 分页功能
// 每页显示条数发生改变时
......
......@@ -48,7 +48,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
</el-form>
......@@ -284,7 +284,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/MoblieLog", {
params: this.searchData,
......
......@@ -78,7 +78,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
</el-form>
......@@ -392,7 +392,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/LingYongList/GetLingYongLog",
......
......@@ -36,7 +36,7 @@
<el-input
v-model="loginForm.UserAccount"
style="width: 350px"
placeholder="请输入登录ID"
placeholder="请输入账号"
>
<i slot="prefix">
<img src="@icons/user.png" alt="" />
......@@ -209,6 +209,12 @@ export default {
menuName: "仓库盘点",
icon: "盘点",
},
{
id: 3 - 6,
path: "/warehouse/equMaintenanceReminder",
menuName: "维护提醒",
icon: "消息提醒",
},
],
},
{
......
......@@ -80,6 +80,7 @@
size="small"
border
highlight-current-row
max-height="460"
>
<el-table-column
width="100"
......@@ -91,9 +92,11 @@
<el-table-column prop="MaterielName" label="物料名称" align="center" />
<el-table-column prop="MaterielCode" label="物料编码" align="center" />
<el-table-column prop="EqTotalCount" label="装备总数" align="center" />
<el-table-column prop="ResCount" label="已贴标数" align="center" />
<el-table-column prop="InStoreCount" label="装备在库数" align="center" />
<el-table-column prop="OutOfStoreCount" label="装备出库数" align="center" />
<el-table-column prop="ResCount" label="装备已注册" align="center" />
<el-table-column prop="WeixiuCount" label="装备维修数" align="center" />
<el-table-column prop="BaofeiCount" label="装备报废数" align="center" />
<el-table-column prop="LibaryName" label="仓库名称" align="center" />
<el-table-column prop="Storage" label="库 位" align="center" />
<el-table-column
......@@ -146,6 +149,7 @@ export default {
Order: "ASC",
OrderBy: "",
MaterialName:"",
LibraryID:"",
},
warehouseOptions:[],
searchWarehouseData: {
......@@ -265,6 +269,7 @@ export default {
async getQueuData() {
this.warehouseOptions=[];
this.loading = true;
this.searchData.MaterialName=this.searchData.MaterialName;
const { data: res } = await this.$axios.get(
"api/ChartStatistics/GetStock",
{
......
......@@ -17,7 +17,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
>
......@@ -70,25 +70,44 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
<!-- <el-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addHCRecive()"
>借用申请(贴标)</el-button
>
>借用申请(贴标)</el-button
> -->
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px; margin-right: 20px"
class="funcButton"
@click="addIssued()"
>借用申请</el-button
>
<el-dialog :visible.sync="addIssuedDialogVisible" title="请选择要创建的借用申请单据类型" width="500px" align="center">
<div slot="footer" class="dialog-footer" align="center">
<el-button
type="warning"
icon="el-icon-box"
@click="addHCRecive()"
>借用申请(不贴标)</el-button
>
<el-button
type="success"
icon="el-icon-box"
@click="addNHCRecive()"
>借用申请(贴标)</el-button
>借用申请(贴标)</el-button
>
<!-- <el-button type="primary" @click="clickOrderType">确认</el-button> -->
</div>
</el-dialog>
</el-form>
<!-- 列表区域 -->
......@@ -118,11 +137,20 @@
<el-table-column prop="ExameReason" label="审核理由" align="center">
</el-table-column>
<el-table-column prop="ExamineTime" label="审核时间" align="center" />
<el-table-column
prop="ExamineStateName"
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="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column prop="Remarks" label="备注" align="center">
</el-table-column>
<el-table-column prop="SubmitReason" label="申请原因" align="center">
......@@ -251,11 +279,11 @@
class="box-card"
style="text-align: center; margin-top: 35px"
>
<label class="labelBorrow">借用装备表(贴标)</label>
<label class="labelBorrow">借用装备表(贴标)</label>
<el-divider></el-divider>
<template>
<el-table :data="HctableData" border class="details">
<el-table-column
<!-- <el-table-column
prop="MaterielName"
label="装备大类"
align="center"
......@@ -266,10 +294,10 @@
label="装备物料"
align="center"
>
</el-table-column>
</el-table-column> -->
<el-table-column
prop="MaterielName"
label="装备名称"
label="物料名称"
align="center"
>
</el-table-column>
......@@ -279,6 +307,12 @@
align="center"
>
</el-table-column>
<el-table-column
prop="LyCount"
label="数量"
align="center"
>
</el-table-column>
</el-table>
</template>
</el-card>
......@@ -287,7 +321,7 @@
class="box-card"
style="text-align: center; margin-top: 35px"
>
<label class="labelBorrow">借用装备表(贴标)</label>
<label class="labelBorrow">借用装备表(贴标)</label>
<el-divider></el-divider>
<template>
<el-table :data="NHctableData" border class="details">
......@@ -737,7 +771,7 @@ export default {
return {
SubmitState: [
{
value: "-3",
value: "-99",
label: "全部",
},
{
......@@ -766,6 +800,7 @@ export default {
},
],
HCVisible: false,
addIssuedDialogVisible:false,
// 用户选中日期
timeData: [],
// 日期配置
......@@ -902,7 +937,6 @@ export default {
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
NameAndCode: "",
epc: "",
EquipmentId: "",
......@@ -1080,7 +1114,7 @@ export default {
},
//新增耗材申请
async addHCRecive() {
this.title = "借用申请(贴标)";
this.title = "借用申请(贴标)";
this.HCVisible = true;
this.HCruleForm.BorrowList = [];
// console.log("rule",this.ruleForm)
......@@ -1091,7 +1125,7 @@ export default {
},
//新增借用申请
async addNHCRecive() {
this.title = "借用申请(贴标)";
this.title = "借用申请(贴标)";
this.addVisible = true;
this.ruleForm.BorrowList = [];
// console.log("rule",this.ruleForm)
......@@ -1100,13 +1134,16 @@ export default {
});
this.classOption = resclass.Rows;
},
addIssued(){
this.addIssuedDialogVisible = true;
},
//编辑信息
async edit(row) {
console.log(row);
if (row.IsHaoCai === 0) {
//非耗材
this.addVisible = true;
this.title = "修改借用申请(贴标)";
this.title = "修改借用申请(贴标)";
this.addVisible = true;
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
......@@ -1118,7 +1155,7 @@ export default {
this.classOption = resclass.Rows;
} else {
//耗材
this.title = "修改借用申请(贴标)";
this.title = "修改借用申请(贴标)";
this.HCVisible = true;
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
......@@ -1380,7 +1417,7 @@ export default {
stateName = "撤销";
}
const url = "/api/Borrow/ChangeState";
this.$confirm("是否" + stateName + "提交该数据?", "提示", {
this.$confirm("是否" + stateName + "该数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -1389,13 +1426,13 @@ export default {
const { data: res } = await this.$axios.post(url, this.editForm);
if (res.Success === true) {
this.getQueuData();
this.$message.success("已" + stateName + "该申请");
this.$message.success("" + stateName + "成功");
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.error("" + stateName + "申请");
this.$message.warning("已取消该" + stateName + "操作");
});
},
// 领取操作
......@@ -1458,7 +1495,7 @@ export default {
const borrowUrl = "/api/Borrow?" + "IsAdmin=" + IsAdmin;
this.$refs[formName].validate(async (valid) => {
if (valid) {
if (type === "借用申请(贴标)") {
if (type === "借用申请(贴标)") {
const { data: res } = await this.$axios.post(
borrowUrl,
this.HCruleForm
......@@ -1473,6 +1510,7 @@ export default {
}
this.getQueuData();
this.HCVisible = false;
this.addIssuedDialogVisible =false;
} else {
return false;
}
......@@ -1493,7 +1531,7 @@ export default {
const borrowUrl = "/api/Borrow?" + "IsAdmin=" + IsAdmin;
this.$refs[formName].validate(async (valid) => {
if (valid) {
if (type === "借用申请(贴标)") {
if (type === "借用申请(贴标)") {
const { data: res } = await this.$axios.post(
borrowUrl,
this.ruleForm
......@@ -1510,13 +1548,33 @@ export default {
}
this.getQueuData();
this.addVisible = false;
this.addIssuedDialogVisible =false;
} else {
return false;
}
});
},
async getQueuData() {
SubmitFormat(row) {
if (row.SubmitState === 1) {
return "待借出";
} else if(row.SubmitState===2) {
return "待归还";
}
else if(row.SubmitState===3)
{
return "已归还";
}
else
{
return row.SubmitStateName;
}
},
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
this.searchData.SubmitUsrID = this.userData.Id;
const { data: res } = await this.$axios.get("api/Borrow", {
......@@ -1552,7 +1610,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消该删除操作");
});
},
......@@ -1571,9 +1629,9 @@ export default {
},
stateFormat(row) {
if (row.IsHaoCai === 0) {
return "贴标";
return "贴标";
} else if (row.IsHaoCai === 1) {
return "贴标";
return "贴标";
} else {
return "";
}
......
......@@ -58,7 +58,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -241,8 +241,8 @@ export default {
this.ruleForm = {
ID: 0,
DepartName: "",
parentName: "",
parentId: "",
//parentName: "",
// parentId: "",
Remarks: "",
};
},
......@@ -311,8 +311,8 @@ export default {
formData.append("ID", this.ruleForm.ID);
formData.append("DepartName", this.ruleForm.DepartName);
formData.append("parentName", this.ruleForm.parentName);
formData.append("parentId", this.ruleForm.parentId);
formData.append("parentName", this.ruleForm.parentName===undefined||this.ruleForm.parentName===null?"":this.ruleForm.parentName);
formData.append("parentId", this.ruleForm.parentId===undefined||this.ruleForm.parentId===null?"":this.ruleForm.parentId);
formData.append("Remarks", this.ruleForm.Remarks===null?"":this.ruleForm.Remarks);
const config = {
......@@ -326,7 +326,7 @@ export default {
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
} else {
//修改仓库类型
// console.log(this.ruleForm.ID)
......@@ -336,7 +336,7 @@ export default {
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
}
this.getQueuData();
this.addVisible = false;
......@@ -383,7 +383,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消删除");
});
},
async getSuperiorDepartment() {
......@@ -428,7 +428,10 @@ export default {
this.getSuperiorDepartment();
});
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/Department", {
params: this.searchData,
......
......@@ -17,7 +17,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
>
......@@ -77,7 +77,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
......@@ -190,7 +190,7 @@
</td>
<th class="textHeader">是否贴标</th>
<td class="textContent">
{{ detailData.IsHaoCai == 1 ? "未贴标" : "已贴标" }}
{{ detailData.IsHaoCai == 1 ? "否" : "是" }}
</td>
<th class="textHeader">数量</th>
<td class="textContentLast">
......@@ -448,11 +448,11 @@ export default {
},
{
value: "1",
label: "贴标",
label: "贴标",
},
{
value: "0",
label: "贴标",
label: "贴标",
},
],
......@@ -692,7 +692,10 @@ export default {
});
},
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,
......@@ -750,9 +753,9 @@ export default {
},
stateFormat(row) {
if (row.IsHaoCai == 0) {
return "已贴标";
return "";
} else {
return "未贴标";
return "";
}
},
closeForm() {
......
......@@ -60,7 +60,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -261,7 +261,7 @@
<el-input
style="width: 300px"
v-model="ruleForm.PoliceCode"
placeholder="请输入警员编号"
placeholder="请输入警员编号(6位)"
></el-input>
</el-form-item>
<el-form-item label="出口指纹机密码" prop="PolicePassword">
......@@ -407,7 +407,7 @@
</td>
<th class="textHeader">单警柜密码</th>
<td class="textContentLast">
{{ detailData.StoragePassword }}
{{ detailData.StoragePassword===null?' ': detailData.StoragePassword}}
</td>
</tr>
<tr>
......@@ -487,6 +487,9 @@ export default {
DeparId: [
{ required: true, message: "请选择所属部门", trigger: "blur" },
],
PoliceCode: [
{ required: true, message: "请输入警员编号", trigger: "blur" },
],
PoliceCategoryId: [
{ required: true, message: "请选择所属警种", trigger: "blur" },
],
......@@ -751,7 +754,7 @@ export default {
formData.append("DeparId", this.ruleForm.DeparId);
formData.append("DepartName", this.ruleForm.DepartName);
formData.append("PoliceCategoryId", this.ruleForm.PoliceCategoryId);
formData.append("PecoliePassword",this.ruleForm.PecoliePassword==null?"":this.ruleForm.PecoliePassword);
formData.append("PecoliePassword",this.ruleForm.PecoliePassword===null?"":this.ruleForm.PecoliePassword);
formData.append(
"PoliceCategoryldName",
this.ruleForm.PoliceCategoryldName
......@@ -905,8 +908,8 @@ export default {
formData.append("ID", this.ruleForm.ID);
formData.append("UserPassword", this.ruleForm.UserPassword);
formData.append("StorageId", this.ruleForm.StorageId);
formData.append("StoragePassword", this.ruleForm.StoragePassword);
console.log("password",this.ruleForm.StoragePassword)
formData.append("StoragePassword", this.ruleForm.StoragePassword===null?"":this.ruleForm.StoragePassword);
console.log("password",this.ruleForm.StoragePassword===null?"":this.ruleForm.StoragePassword)
console.log("pass",formData);
if(this.ruleForm.ID!==0)
{
......@@ -940,7 +943,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消删除");
});
},
//修改部门
......@@ -1026,7 +1029,10 @@ export default {
this.getSuperiorDepartment();
this.GetPoliceCategory();
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/User", {
params: this.searchData,
......
......@@ -60,7 +60,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -345,7 +345,10 @@ export default {
this.$nextTick(()=>{
this.resetForm('ruleForm')})
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/PoliceCategory", {
params: this.searchData,
......
......@@ -17,7 +17,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
>
......@@ -70,7 +70,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -104,17 +104,26 @@
<el-table-column prop="ExameReason" label="审核理由" align="center">
</el-table-column>
<el-table-column prop="ExamineTime" label="审核时间" align="center" />
<el-table-column
prop="ExamineStateName"
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="SubmitStateName"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column prop="Remarks" label="备注" align="center">
</el-table-column>
<el-table-column
label="操作"
align="left"
fixed="right"
width="240px"
prop="SubmitState"
>
......@@ -484,7 +493,7 @@ export default {
SubmitState: [
{
value: "-3",
value: "-99",
label: "全部",
},
{
......@@ -753,7 +762,7 @@ export default {
},
//新增领用申请
async addRecive() {
this.title = "领用申请(贴标物资)";
this.title = "领用申请(贴标物资)";
this.addVisible = true;
this.ruleForm.BorrowList = [];
// console.log("rule",this.ruleForm)
......@@ -850,6 +859,10 @@ export default {
},
//添加装备
addEquipment() {
if(this.AddPlanForm.MaterielId==="")
{
return this.$message.warning("请选择物料添加");
}
var obj = {};
var plan = {
LyCount: 1,
......@@ -863,7 +876,7 @@ export default {
};
console.log("添加物资", plan);
obj = this.ruleForm.BorrowList.find(function (item) {
return item.EqSizeId === plan.EqSizeId;
return item.MaterielID === plan.MaterielID;
});
if (obj === undefined) {
this.ruleForm.BorrowList.push(plan);
......@@ -892,7 +905,7 @@ export default {
stateName="撤销"
}
const url = "/api/Borrow/ChangeState" ;
this.$confirm("是否"+stateName+"提交该数据?", "提示", {
this.$confirm("是否"+stateName+"该数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -907,7 +920,7 @@ export default {
}
})
.catch((e) => {
this.$message.error(""+stateName+"申请");
this.$message.warning("已取消该"+stateName+"操作");
});
},
......@@ -942,7 +955,7 @@ export default {
}
})
.catch((e) => {
this.$message.error(""+stateName+"操作");
this.$message.warning("已取消"+stateName+"操作");
});
},
......@@ -956,12 +969,12 @@ export default {
const borrowUrl = "/api/Borrow?" + "IsAdmin=" + IsAdmin;
this.$refs[formName].validate(async (valid) => {
if (valid) {
if (type === "领用申请(贴标物资)") {
if (type === "领用申请(贴标物资)") {
const { data: res } = await this.$axios.post(
borrowUrl,
this.ruleForm
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
} else {
//修改预案类型
// console.log(this.ruleForm.ID)
......@@ -969,7 +982,7 @@ export default {
borrowUrl,
this.ruleForm
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
}
this.getQueuData();
this.addVisible = false;
......@@ -990,8 +1003,21 @@ export default {
// "userData",
// ]),
// },
async getQueuData() {
SubmitFormat(row) {
if (row.SubmitStateName === '同意申请') {
return "待领取";
}else if(row.SubmitStateName==='等待审批') {
return "待审批";
}
else
{
return row.SubmitStateName;
}
},
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.borrowType=0;
this.loading = true;
this.searchData.SubmitUsrID = this.userData.Id;
......@@ -1028,7 +1054,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消该删除操作");
});
},
......@@ -1047,9 +1073,9 @@ export default {
},
stateFormat(row) {
if (row.EqHaoCai === 0) {
return "贴标";
return "贴标";
} else {
return "贴标";
return "贴标";
}
},
closeForm() {
......
......@@ -17,7 +17,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
>
......@@ -70,25 +70,44 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
<!-- <el-button
type="primary"
icon="el-icon-plus"
style="height: 40px"
class="funcButton"
@click="addHCRecive()"
>维修申请(贴标)</el-button
>
>维修申请(贴标)</el-button
> -->
<el-button
type="primary"
icon="el-icon-plus"
style="height: 40px; margin-right: 20px"
class="funcButton"
@click="addIssued()"
>维修申请</el-button
>
<el-dialog :visible.sync="addIssuedDialogVisible" title="请选择要创建的维修下发单据类型" width="500px" align="center">
<div slot="footer" class="dialog-footer" align="center">
<el-button
type="warning"
icon="el-icon-setting"
@click="addHCRecive()"
>维修申请(不贴标)</el-button
>
<el-button
type="success"
icon="el-icon-setting"
@click="addNHCRecive()"
>维修申请(已贴标)</el-button
>维修申请(贴标)</el-button
>
<!-- <el-button type="primary" @click="clickOrderType">确认</el-button> -->
</div>
</el-dialog>
</el-form>
<!-- 列表区域 -->
......@@ -118,11 +137,19 @@
<el-table-column prop="ExameReason" label="审核理由" align="center">
</el-table-column>
<el-table-column prop="ExamineTime" label="审核时间" align="center" />
<el-table-column
prop="ExamineStateName"
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="SubmitState"
label="当前状态"
:formatter="SubmitFormat"
align="center"
/>
<el-table-column prop="Remarks" label="备注" align="center">
</el-table-column>
<el-table-column prop="SubmitReason" label="申请原因" align="center">
......@@ -271,11 +298,11 @@
class="box-card"
style="text-align: center; margin-top: 35px"
>
<label class="labelBorrow">维修装备表(贴标)</label>
<label class="labelBorrow">维修装备表(贴标)</label>
<el-divider></el-divider>
<template>
<el-table :data="HctableData" border class="details">
<el-table-column
<!-- <el-table-column
prop="MaterielName"
label="装备大类"
align="center"
......@@ -286,10 +313,10 @@
label="装备物料"
align="center"
>
</el-table-column>
</el-table-column> -->
<el-table-column
prop="MaterielName"
label="装备名称"
label="物料名称"
align="center"
>
</el-table-column>
......@@ -299,6 +326,12 @@
align="center"
>
</el-table-column>
<el-table-column
prop="LyCount"
label="数量"
align="center"
>
</el-table-column>
</el-table>
</template>
</el-card>
......@@ -307,7 +340,7 @@
class="box-card"
style="text-align: center; margin-top: 35px"
>
<label class="labelBorrow">维修装备表(贴标)</label>
<label class="labelBorrow">维修装备表(贴标)</label>
<el-divider></el-divider>
<template>
<el-table :data="NHctableData" border class="details">
......@@ -757,7 +790,7 @@ export default {
return {
SubmitState: [
{
value: "-3",
value: "-99",
label: "全部",
},
{
......@@ -786,6 +819,7 @@ export default {
},
],
HCVisible: false,
addIssuedDialogVisible:false,
// 用户选中日期
timeData: [],
// 日期配置
......@@ -1100,7 +1134,7 @@ export default {
},
//新增耗材申请
async addHCRecive() {
this.title = "维修申请(贴标)";
this.title = "维修申请(贴标)";
this.HCVisible = true;
this.HCruleForm.BorrowList = [];
// console.log("rule",this.ruleForm)
......@@ -1111,7 +1145,7 @@ export default {
},
//新增维修申请
async addNHCRecive() {
this.title = "维修申请(贴标)";
this.title = "维修申请(贴标)";
this.addVisible = true;
this.ruleForm.BorrowList = [];
// console.log("rule",this.ruleForm)
......@@ -1120,13 +1154,16 @@ export default {
});
this.classOption = resclass.Rows;
},
addIssued(){
this.addIssuedDialogVisible = true;
},
//编辑信息
async edit(row) {
console.log(row);
if (row.IsHaoCai === 0) {
//非耗材
this.addVisible = true;
this.title = "修改维修申请(贴标)";
this.title = "修改维修申请(贴标)";
this.addVisible = true;
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
......@@ -1138,7 +1175,7 @@ export default {
this.classOption = resclass.Rows;
} else {
//耗材
this.title = "修改维修申请(贴标)";
this.title = "修改维修申请(贴标)";
this.HCVisible = true;
var url = "api/Borrow/" + row.ID;
const { data: res } = await this.$axios.get(url);
......@@ -1415,7 +1452,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("" + stateName + "申请");
this.$message.warning("已取消该" + stateName + "操作");
});
},
// 领取操作
......@@ -1478,7 +1515,7 @@ export default {
const borrowUrl = "/api/Borrow?" + "IsAdmin=" + IsAdmin;
this.$refs[formName].validate(async (valid) => {
if (valid) {
if (type === "维修申请(贴标)") {
if (type === "维修申请(贴标)") {
const { data: res } = await this.$axios.post(
borrowUrl,
this.HCruleForm
......@@ -1493,6 +1530,7 @@ export default {
}
this.getQueuData();
this.HCVisible = false;
this.addIssuedDialogVisible =false;
} else {
return false;
}
......@@ -1513,7 +1551,7 @@ export default {
const borrowUrl = "/api/Borrow?" + "IsAdmin=" + IsAdmin;
this.$refs[formName].validate(async (valid) => {
if (valid) {
if (type === "维修申请(贴标)") {
if (type === "维修申请(贴标)") {
const { data: res } = await this.$axios.post(
borrowUrl,
this.ruleForm
......@@ -1530,13 +1568,31 @@ export default {
}
this.getQueuData();
this.addVisible = false;
this.addIssuedDialogVisible =false;
} else {
return false;
}
});
},
async getQueuData() {
SubmitFormat(row) {
if (row.SubmitState === 1) {
return "待出库";
} else if(row.SubmitState===2) {
return "待入库";
}
else if(row.SubmitState===3)
{
return "已入库";
}
else
{
return row.SubmitStateName;
}
},
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
this.searchData.SubmitUsrID = this.userData.Id;
const { data: res } = await this.$axios.get("api/Borrow", {
......@@ -1572,7 +1628,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消该删除操作");
});
},
//借出/归还
......@@ -1603,13 +1659,13 @@ export default {
const { data: res } = await this.$axios.post(url,this.editForm);
if (res.Success === true) {
this.getQueuData();
this.$message.success("已"+stateName);
this.$message.success("已"+stateName+"成功");
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.error(""+stateName+"操作");
this.$message.warning("已取消"+stateName+"操作");
});
},
......@@ -1628,9 +1684,9 @@ export default {
},
stateFormat(row) {
if (row.IsHaoCai === 0) {
return "贴标";
return "贴标";
} else if (row.IsHaoCai === 1) {
return "贴标";
return "贴标";
} else {
return "";
}
......
......@@ -598,7 +598,7 @@ export default {
},
};
if (type === "添加装备(贴标)") {
if (type === "添加装备(贴标)") {
const { data: res } = await this.$axios.post(
"/api/Equipment",
formData,
......@@ -915,9 +915,9 @@ export default {
},
stateFormat(row) {
if (row.EqHaoCai === 0) {
return "贴标";
return "贴标";
} else {
return "贴标";
return "贴标";
}
},
},
......
......@@ -69,7 +69,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -110,8 +110,8 @@
</el-table-column>
<el-table-column prop="Remarks" label="备注" align="center">
</el-table-column>
<el-table-column prop="CreateName" label="创建人" align="center">
</el-table-column>
<!-- <el-table-column prop="CreateName" label="创建人" align="center">
</el-table-column> -->
<el-table-column prop="CreateTime" label="创建日期" sortable align="center">
</el-table-column>
<el-table-column label="操作" width="200" align="center">
......@@ -146,6 +146,17 @@
>
</template>
</el-table-column>
<el-table-column label="储位灯开关" width="160" align="center">
<template v-slot="scope">
<el-switch
v-model="scope.row.isOpen"
@change="changeLight(scope.row)"
:active-isOpen="true"
:inactive-isOpen="false"
>
</el-switch>
</template>
</el-table-column>
</el-table>
<!-- 查看详情 -->
<el-dialog title="查看储位详情" :visible.sync="borrowTableVisible" width="73%">
......@@ -191,7 +202,7 @@
</td>
<th class="textHeader">所属人员</th>
<td class="textContent">
{{ detailData.UserName ? detailData.UserName : "无所属" }}
{{ detailData.PoliceName ? detailData.PoliceName : "无所属" }}
</td>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">储位灯光 IP地址</th>
......@@ -378,7 +389,7 @@
label="柜子灯地址"
prop="RightAddress"
>
<el-input v-model="ruleForm.RightAddress" placeholder="GPIO的IP: 端口(9701)-接口(0、1、2...)"></el-input>
<el-input v-model="ruleForm.RightAddress" placeholder="例: 41.204.124.185:9701-12"></el-input>
</el-form-item>
<el-form-item
......@@ -386,7 +397,7 @@
label="地面灯地址"
prop="YinDaoAddress"
>
<el-input type="textarea" :rows='5' v-model="ruleForm.YinDaoAddress" placeholder="地面灯带引导灯GPIO的IP: 端口(9701)-接口(0、1、2...),需配置多个时记得使用回车进行换行"></el-input>
<el-input type="textarea" :rows='5' v-model="ruleForm.YinDaoAddress" placeholder="例: 41.204.124.185:9701-12,需配置多个时记得使用回车进行换行"></el-input>
</el-form-item>
<el-form-item label="备注" prop="Remarks">
......@@ -439,6 +450,7 @@ export default {
inject:['reload'],
data() {
return {
isOpen: false,
rules: {
StorageCode: [
{ required: true, message: "请输入储位名称", trigger: "blur" },
......@@ -573,12 +585,29 @@ export default {
},
methods: {
//改变灯光状态
async changeLight(row){
//console.log('改变灯光状态')
this.code=row.StorageCode;
this.isOpen=row.isOpen;
//console.log('kd'+ this.code +this.isOpen)
const { data: res } = await this.$axios.post("api/Storage/ControlStorageLight",
{code: this.code,isOpen: this.isOpen}
);
if (res.Success !== true) return this.$message.error(res.Remark);
// 提交信息成功后要关闭对话框,并且刷新数据
if(this.isOpen==true){
this.$message.success("灯光已打开,若未手动开闭,5分钟后自动关闭!");
}else{
this.$message.success("已手动开闭!");
}
},
//提交表单
submitForm(formName, type) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
const formData = new FormData();
console.log("ru", this.ruleForm);
//console.log("ru", this.ruleForm);
formData.append("ID", this.ruleForm.ID);
formData.append("StorageCode", this.ruleForm.StorageCode);
formData.append("StorageType", this.ruleForm.StorageType2);
......@@ -586,8 +615,8 @@ export default {
formData.append("LibraryId", this.ruleForm.LibraryId);
formData.append("Remarks", this.ruleForm.Remarks===null?"":this.ruleForm.Remarks);
formData.append("LockAddress", this.ruleForm.LockAddress);
formData.append("RightAddress", this.ruleForm.RightAddress);
formData.append("YinDaoAddress", this.ruleForm.YinDaoAddress);
formData.append("RightAddress", this.ruleForm.RightAddress===null?"":this.ruleForm.RightAddress);
formData.append("YinDaoAddress", this.ruleForm.YinDaoAddress===null?"":this.ruleForm.YinDaoAddress);
const config = {
headers: {
......@@ -600,17 +629,18 @@ export default {
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message('储位名称重复,请重新输入');
} else {
//修改储位
formData.append("ID", this.ruleForm.ID);
console.log(formData.append("ID", this.ruleForm.ID));
const { data: res } = await this.$axios.put(
"/api/Storage",
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message('储位名称重复,请重新输入');
}
this.getQueuData();
this.addVisible = false;
......@@ -649,7 +679,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消删除");
});
},
......@@ -755,7 +785,10 @@ export default {
this.Users = User.Rows;
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/Storage", {
......
......@@ -60,7 +60,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -625,8 +625,8 @@
</template>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="baseTableVisible = false"
>确 定</el-button
<el-button @click="baseTableVisible = false"
>关 闭</el-button
>
</div>
</el-dialog>
......@@ -888,7 +888,7 @@ export default {
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
this.getQueuData();
},
//修改
......@@ -923,7 +923,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消删除");
});
},
///获取装备模块内容
......@@ -1015,7 +1015,10 @@ export default {
});
this.PlanModelOption = resPlanMod.Rows;
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/Plan", {
params: this.searchData,
......
<template>
<el-dialog title="保养记录表" :visible.sync="byVisible" width="60%">
<el-row style="margin-top: 10px">
<!-- 主表 -->
<el-table
:data="baoYangData"
stripe
style="width: 100%;margin-top: 10px;"
size="small"
border
highlight-current-row
max-height="600"
>
<el-table-column prop="ID" v-if="false" />
<el-table-column prop="EqId" v-if="false" />
<el-table-column prop="EqName" label="装备名称" align="center" />
<el-table-column prop="EqCode" label="装备编号" align="center">
</el-table-column>
<el-table-column prop="BaoyangPersonName" label="保养人" align="center">
</el-table-column>
<el-table-column prop="BaoyangTime" label="保养时间" align="center" />
<el-table-column prop="Remark" label="保养备注" align="center" />
<!-- <el-table-column label="操作" width="200" align="center">
<template v-slot="scope">
<a-button
type="primary"
class="actions"
ghost
round
size="small"
@click="equCheck(scope.row)"
>查看</a-button
>
<a-button
style="color:#5ab96b;border-color: #5ab96b;"
type="primary"
class="actions"
ghost
round
size="small"
@click="baoYangClick(scope.row)"
>保养</a-button
>
</template>
</el-table-column> -->
</el-table>
<!-- 分页功能 -->
<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>
</el-dialog>
</template>
<script>
export default {
data() {
return {
byVisible: false,
baoYangData: [],
detailData: [],
// 总条数
total: 0,
searchData: {
Page: 1,
Rows: 10,
Sort: "ID",
Order: "ESC",
Epc: "",
EqName:"",
EqCode:"",
EqId:"",
},
};
},
created() {
//this.getQueuDataList();
},
methods: {
async getQueuDataList(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("/api/Equipment/GetBaoYangLogListByPage", {
params: this.searchData,
});
this.total = res.Total;
this.baoYangData = res.Rows;
},
//查看信息
async equCheck(row) {
this.borrowTableVisible = true;
const borrowUrl = "/api/Equipment/" + row.ID;
const { data: res } = await this.$axios.get(borrowUrl);
if (res.Success == false) return this.$message(res.Remark);
this.detailData = res;
console.log("ro",row)
this.videoUrl=row.VideoUrl;
this.videoUrlSrc=window._CONFIG['dlURL']+'/'+this.videoUrl;
},
stateFormat(row) {
if (row.EqHaoCai === 0) {
return "是";
} else {
return "否";
}
},
// 每页显示条数发生改变时
handleSizeChange(val) {
this.searchData.Rows = val;
this.getQueuDataList();
},
// 当前页数发生改变时
handleCurrentChange(val) {
this.searchData.Page = val;
this.getQueuDataList();
},
},
};
</script>
\ No newline at end of file
<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-tabs v-model="activeName" tab-position="left" @tab-click="handleClick">
<el-tab-pane label="保养提醒" name="0" >
<div align="right"> <el-button type="primary" icon="el-icon-document" @click="baoYangLogList">保养记录</el-button></div>
<el-row style="margin-top: 10px">
<!-- 主表 -->
<el-table
v-loading="loading"
:data="borrowData"
stripe
style="width: 100%;margin-top: 10px;"
size="small"
border
highlight-current-row
max-height="600"
>
<el-table-column prop="ID" v-if="false" />
<el-table-column prop="EqName" label="装备名称" align="center" />
<!-- <el-table-column label="基本信息" align="center"> -->
<el-table-column prop="EqCount" label="装备数量" align="center">
</el-table-column>
<el-table-column prop="EqCode" label="装备编号" align="center">
</el-table-column>
<el-table-column
prop="LocationName"
label="所属储位"
align="center"
>
</el-table-column>
<el-table-column
prop="StateName"
label="装备状态"
align="center"
>
</el-table-column>
<!-- </el-table-column> -->
<!-- <el-table-column label="装备信息" align="center"> -->
<el-table-column
prop="CategoryName"
label="装备类型"
align="center"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="所属物料"
align="center"
>
</el-table-column>
<!-- </el-table-column> -->
<el-table-column prop="LibraryName" label="所属仓库" align="center" />
<el-table-column
prop="EqHaoCai"
:formatter="stateFormat"
label="是否贴标"
align="center"
/>
<el-table-column prop="BaoYangDays" label="保养时间(天)" align="center" />
<el-table-column prop="NextBaoYang" :formatter="formDate" label="下次保养时间" width="150" align="center" />
<!-- <el-table-column prop="LabelEpc" label="EPC编码" align="center" /> -->
<!-- <el-table-column prop="Remarks" label=" 备注" align="center" /> -->
<el-table-column label="操作" width="200" align="center">
<template v-slot="scope">
<a-button
type="primary"
class="actions"
ghost
round
size="small"
@click="equCheck(scope.row)"
>查看</a-button
>
<!-- <a-button
type="primary"
class="actions"
ghost
round
size="small"
@click="edit(scope.row)"
>修改</a-button
> -->
<a-button
style="color:#5ab96b;border-color: #5ab96b;"
type="primary"
class="actions"
ghost
round
size="small"
@click="baoYangClick(scope.row)"
>保养</a-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页功能 -->
<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>
</el-tab-pane>
<el-tab-pane label="报废提醒" name="1" >
<div>
<!-- 搜索 -->
<!-- <el-radio-group v-model="baoFeiDay" style="padding-bottom: 10px;margin-right: 20px;" @input="baoFeiChang">
<el-radio-button label="2" name="2">即将报废</el-radio-button>
<el-radio-button label="3" name="3">已超期未报废</el-radio-button>
</el-radio-group> -->
<!-- <el-radio-group v-model="days" style="padding-bottom: 10px;" @input="toBaoFDaysTx" v-if="baoFeiDay=='2'">
<el-radio-button label="10" name="10">10天内</el-radio-button>
<el-radio-button label="30" name="30">30天内</el-radio-button>
</el-radio-group> -->
<el-form
:inline="true"
:model="searchData"
size="medium"
label-position="left"
>
<el-select v-model="searchData.baoFeiStatus" placeholder="请选择提醒状态" style="margin-right: 20px;" @change="changeBfStatus">
<el-option
v-for="item in baoFeiOptions"
:key="item.value"
:label="item.label"
:value="item.label">
</el-option>
</el-select>
<el-select v-model="searchData.IsLjBaoFeiDay" placeholder="请选择临近报废天数" v-if="searchData.baoFeiStatus=='即将报废'" style="margin-right: 20px;">
<el-option
v-for="item in daysOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<a-button
type="primary"
class="actions"
ghost
round
@click="getQueuData(1)"
>查询</a-button>
</el-form>
</div>
<el-row style="margin-top: 10px">
<!-- 主表 -->
<el-table
v-loading="loading"
:data="borrowData"
stripe
style="width: 100%"
size="small"
border
highlight-current-row
max-height="600"
>
<el-table-column prop="ID" v-if="false" />
<el-table-column prop="EqName" label="装备名称" align="center" />
<!-- <el-table-column label="基本信息" align="center"> -->
<el-table-column prop="EqCount" label="装备数量" align="center">
</el-table-column>
<el-table-column prop="EqCode" label="装备编号" align="center">
</el-table-column>
<el-table-column
prop="LocationName"
label="所属储位"
align="center"
>
</el-table-column>
<el-table-column
prop="StateName"
label="装备状态"
align="center"
>
</el-table-column>
<!-- </el-table-column> -->
<!-- <el-table-column label="装备信息" align="center"> -->
<el-table-column
prop="CategoryName"
label="装备类型"
align="center"
>
</el-table-column>
<el-table-column
prop="MaterielName"
label="所属物料"
align="center"
>
</el-table-column>
<!-- </el-table-column> -->
<el-table-column prop="LibraryName" label="所属仓库" align="center" />
<!-- <el-table-column prop="CreateTime" label="创建时间" align="center" /> -->
<el-table-column
prop="EqHaoCai"
:formatter="stateFormat"
label="是否贴标"
align="center"
/>
<el-table-column prop="BuyTime" :formatter="formDate" label="采购日期" width="150" align="center" />
<el-table-column prop="TermTime" :formatter="formDate" label="报废日期" width="150" align="center" />
<!-- <el-table-column prop="LabelEpc" label="EPC编码" align="center" /> -->
<!-- <el-table-column prop="Remarks" label=" 备注" align="center" /> -->
<el-table-column label="操作" width="200" align="center">
<template v-slot="scope">
<a-button
type="primary"
class="actions"
ghost
round
size="small"
@click="equCheck(scope.row)"
>查看</a-button
>
<!-- <a-button
type="primary"
class="actions"
ghost
round
size="small"
@click="edit(scope.row)"
>修改</a-button
> -->
<a-button
type="danger"
class="actions"
ghost
round
size="small"
@click="baoFei(scope.row)"
>报废</a-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页功能 -->
<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>
</el-tab-pane>
</el-tabs>
<!-- 装备查看详情组件 -->
<el-dialog title="查看详情" :visible.sync="borrowTableVisible" width="60%">
<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.EqName }}
</td>
<th class="textHeader">装备编号</th>
<td class="textContent">
{{ detailData.EqCode }}
</td>
<th class="textHeader">装备类型</th>
<td class="textContentLast">
{{ detailData.EqTypeName }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">所属部门</th>
<td class="textContent">
{{
detailData.DepartName ? detailData.DepartName : "无所属"
}}
</td>
<th class="textHeader">所属人员:</th>
<td class="textContent">
{{ detailData.UserName ? detailData.UserName : "无所属" }}
</td>
<th class="textHeader">所在柜号</th>
<td class="textContentLast">
{{ detailData.LocationName }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">创建时间</th>
<td class="textContent">
{{ detailData.CreateTime }}
</td>
<th class="textHeader">创建人员</th>
<td class="textContent">
{{ detailData.CreateName }}
</td>
<th class="textHeader">保养周期</th>
<td class="textContentLast">
{{
detailData.BaoYangDays
? detailData.BaoYangDays + " 天"
: "- 天"
}}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">下次保养</th>
<td class="textContent">
{{
(detailData.NextBaoYang
? detailData.NextBaoYang
: "无需保养").split(' ')[0]
}}
</td>
<th class="textHeader">贴标时间</th>
<td class="textContent">
{{ detailData.LabelTime }}
</td>
<th class="textHeader">EPC编号</th>
<td class="textContentLast">
{{ detailData.LabelEpc }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">TID编号</th>
<td class="textContent">
{{ detailData.LabelTid }}
</td>
<th class="textHeader">采购日期</th>
<td class="textContent">
{{ (detailData.BuyTime ? detailData.BuyTime : "暂无" ||' ').split(' ')[0] }}
</td>
<th class="textHeader">报废期限</th>
<td class="textContentLast">
{{ (detailData.TermTime ? detailData.TermTime : "暂无" ||' ').split(' ')[0] }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">采购价格</th>
<td class="textContent">
{{ detailData.Price ? detailData.Price : "-" + "¥" }}
</td>
<th class="textHeader">装备状态</th>
<td class="textContent">
{{ detailData.StateName }}
</td>
<th class="textHeader">数量</th>
<td class="textContentLast">
{{ detailData.EqCount }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8" >
<th class="textHeader">备注信息</th>
<td class="textContentLast">
{{ detailData.Instructions }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">视频查看</th>
<td class="textContentLast">
<video height="250px" width="300px" v-if="videoUrl !=''&& videoUrl !=null"
v-bind:src="videoUrlSrc"
class="avatar video-avatar"
controls="controls">
您的浏览器不支持视频播放
</video>
</td>
</tr>
</tbody>
</table>
</div>
</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 title="装备保养" :visible.sync="baoYangTableVisible" width="60%">
<el-card >
<el-form
:model="ruleBaoYangForm"
ref="ruleSet"
label-width="100px"
style="margin-top: 10px"
>
<!-- class="inputClass" -->
<el-row :gutter="90">
<el-col :span="10">
<el-form-item style="padding-left: 32px" label="部门选择">
<treeselect
style="width: 205px; float: left; margin-left: 1px"
noOptionsText="暂无数据"
:options="departOptions"
placeholder="请选择上级部门"
:normalizer="normalizer"
@select="selectDepart"
/>
</el-form-item>
<el-form-item
style="padding-left: 32px"
label="人员选择"
>
<el-select
style=" float: left; margin-left: 1px"
v-model="ruleBaoYangForm.BaoyangPersonId"
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="10">
<el-form-item class="diaB" label="本次保养时间">
<el-date-picker
v-model="ruleBaoYangForm.BaoyangTime"
value-format="yyyy-MM-dd"
class="inputA"
type="date"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="保养备注" class="labelClass">
<el-input
class="labelClassT"
type="textarea"
:rows="2"
v-model="ruleBaoYangForm.Remark"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card style="margin-top: 3px">
<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.EqName }}
</td>
<th class="textHeader">装备编号</th>
<td class="textContent">
{{ detailData.EqCode }}
</td>
<th class="textHeader">装备类型</th>
<td class="textContentLast">
{{ detailData.EqTypeName }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">所属部门</th>
<td class="textContent">
{{
detailData.DepartName ? detailData.DepartName : "无所属"
}}
</td>
<th class="textHeader">所属人员:</th>
<td class="textContent">
{{ detailData.UserName ? detailData.UserName : "无所属" }}
</td>
<th class="textHeader">所在柜号</th>
<td class="textContentLast">
{{ detailData.LocationName }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">创建时间</th>
<td class="textContent">
{{ detailData.CreateTime }}
</td>
<th class="textHeader">创建人员</th>
<td class="textContent">
{{ detailData.CreateName }}
</td>
<th class="textHeader">保养周期</th>
<td class="textContentLast">
{{
detailData.BaoYangDays
? detailData.BaoYangDays + " 天"
: "- 天"
}}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">下次保养</th>
<td class="textContent">
{{
(detailData.NextBaoYang
? detailData.NextBaoYang
: "无需保养").split(' ')[0]
}}
</td>
<th class="textHeader">贴标时间</th>
<td class="textContent">
{{ detailData.LabelTime }}
</td>
<th class="textHeader">EPC编号</th>
<td class="textContentLast">
{{ detailData.LabelEpc }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">TID编号</th>
<td class="textContent">
{{ detailData.LabelTid }}
</td>
<th class="textHeader">采购日期</th>
<td class="textContent">
{{ (detailData.BuyTime ? detailData.BuyTime : "暂无" ||' ').split(' ')[0] }}
</td>
<th class="textHeader">报废期限</th>
<td class="textContentLast">
{{ (detailData.TermTime ? detailData.TermTime : "暂无" ||' ').split(' ')[0] }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8">
<th class="textHeader">采购价格</th>
<td class="textContent">
{{ detailData.Price ? detailData.Price : "-" + "¥" }}
</td>
<th class="textHeader">装备状态</th>
<td class="textContent">
{{ detailData.StateName }}
</td>
<th class="textHeader">数量</th>
<td class="textContentLast">
{{ detailData.EqCount }}
</td>
</tr>
<tr style="border-bottom: 1px solid #e8e8e8" >
<th class="textHeader">备注信息</th>
<td class="textContentLast">
{{ detailData.Instructions }}
</td>
</tr>
</tbody>
</table>
</div>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="baoYangTableVisible = false">关 闭</el-button>
<el-button type="primary" @click="submitBaoYangForm"
>提 交</el-button
>
</div>
</el-dialog>
<!-- 引入组件-保养记录表 -->
<baoYangLogList ref="equMaintenanceLog"/>
</div>
</div>
</template>
<script>
import Treeselect from "@riophae/vue-treeselect";
import equCheck from '../baseInfo/equipmentManage'
import baoYangLogList from './equMaintenanceLog'
export default {
components: { equCheck, Treeselect ,baoYangLogList},
data() {
return {
baoFeiStatus:'即将报废',
activeName: '0',
loading: false,
borrowTableVisible: false,
baoYangTableVisible:false,
borrowData: [],
detailData: [],
departOptions:[],
classOption:[],
policeOptions: [],
videoUrl:"",
videoUrlSrc:"",
// 总条数
total: 0,
baoFeiOptions: [
{
value: "0",
label: "即将报废",
},
{
value: "1",
label: "已超期未报废",
},
],
daysOptions: [
{
value: "10",
label: "10天",
},
{
value: "30",
label: "30天",
},
],
searchData: {
Page: 1,
Rows: 10,
Sort: "ID",
//Order: "ESC",
Epc: "",
//LibraryName: "",
IsLjBaoYang:"1",
baoFeiStatus:"",
IsLjBaoFeiDay:"",
},
AddBaoyangForm: {
parentName: "",
parentId: "",
MaterielName: "",
MainClass: "",
MaterielId: "",
EqSizeId: "",
EqSizeName: "",
EquipmentId: "",
EquipmentName: "",
},
searchUserData: {
Page: 1,
Rows: 999,
Sort: "ID",
Order: "ASC",
DeparId: "",
},
ruleBaoYangForm: {
ID: 0,
Remark: "",
BaoyangPersonId:'',
BaoyangPersonName:'',
EqId:'',
EqName:'',
EqCode:'',
BaoyangTime:'',
},
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.activeName = this.$route.query.activeName;
this.searchData.IsLjBaoYang=this.$route.query.IsLjBaoYang;
if(this.searchData.IsLjBaoYang=='1'){
this.searchData.IsLjBaoFeiDay=this.$route.query.IsLjBaoFeiDay;
this.searchData.IsLjBaoYang=this.$route.query.IsLjBaoYang;
this.getQueuData();
}else if(this.searchData.IsLjBaoYang==''){
this.searchData.baoFeiStatus=this.$route.query.baoFeiStatus;
this.searchData.IsLjBaoFeiDay=this.$route.query.IsLjBaoFeiDay;
this.searchData.IsLjBaoYang=this.$route.query.IsLjBaoYang;
this.getQueuData();
}else {
this.searchData.IsLjBaoYang='1';
this.getQueuData();
}
},
methods: {
async getQueuData(arg) {
if(arg==1) {
this.searchData.Page = 1;
}
if(arg==2) {
this.searchData.IsLjBaoYang = '1';
}
this.loading = true;
const { data: res } = await this.$axios.get("api/Equipment", {
params: this.searchData,
});
this.total = res.Total;
//this.borrowData.NextBaoYang=(res.Rows.NextBaoYang).split(' ')[0];
this.borrowData = res.Rows;
this.timer = setTimeout(() => {
//设置延迟执行
this.loading = false;
//console.log('bf')
}, 300);
},
async baoYangClick(row){
this.baoYangTableVisible=true;
const borrowUrl = "/api/Equipment/" + row.ID;
const { data: res } = await this.$axios.get(borrowUrl);
if (res.Success == false) return this.$message(res.Remark);
this.detailData = res;
this.ruleBaoYangForm.EqId=res.ID;
this.ruleBaoYangForm.EqName=res.EqName;
this.ruleBaoYangForm.EqCode=res.EqCode;
const depart = "/api/Department/" + 0;
const { data: resdepartment } = await this.$axios.get(depart);
this.departOptions = resdepartment;
},
//提交表单
async submitBaoYangForm() {
const formData = new FormData();
formData.append("EqId", this.ruleBaoYangForm.EqId);
formData.append("EqCode", this.ruleBaoYangForm.EqCode);
formData.append("EqName", this.ruleBaoYangForm.EqName);
formData.append("BaoyangTime", this.ruleBaoYangForm.BaoyangTime);
formData.append("Remark", this.ruleBaoYangForm.Remark===undefined?"":this.ruleBaoYangForm.Remark);
if(this.ruleBaoYangForm.BaoyangPersonId==''|| this.ruleBaoYangForm.BaoyangPersonId==undefined){
return this.$message.warning('请选择人员');
}
formData.append("BaoyangPersonId", this.ruleBaoYangForm.BaoyangPersonId);
formData.append("BaoyangPersonName", this.ruleBaoYangForm.BaoyangPersonName);
const config = {
headers: {
"Content-Type": "multipart/form-data",
},
};
const { data: res } = await this.$axios.post(
"/api/Equipment/UpdateBaoYang",
formData,
config
);
this.getQueuData();
this.baoYangTableVisible = false;
if (res.Success !== true) return this.$message.error(res.Remark);
else
{
return this.$message.success('保养成功');
}
},
//获取保养历史表
async baoYangLogList(){
const _this = this.$refs.equMaintenanceLog
_this.byVisible = true;
//执行子组件方法
_this.getQueuDataList();
},
stateFormat(row) {
if (row.EqHaoCai === 0) {
return "是";
} else {
return "否";
}
},
//时间显示处理---2022-03-03 00:00:00为2022-03-03
formDate(row, column, cellValue, index){
const date = new Date(cellValue)
const year = date.getFullYear()
const month = (date.getMonth() + 1).toString().padStart(2, '0')
const day = date.getDate().toString().padStart(2, '0')
return `${year}-${month}-${day}`
},
handleClick() {
if(this.activeName=='0'){
this.searchData.IsLjBaoYang=1;
this.searchData.IsLjBaoFeiDay='';
this.getQueuData(1);
// console.log("yyyy")
}else{
this.searchData.IsLjBaoYang='';
this.searchData.baoFeiStatus='即将报废'
this.searchData.IsLjBaoFeiDay='10';
this.getQueuData(1);
//console.log("ffff")
}
},
changeBfStatus(){
this.searchData.IsLjBaoYang='';
if(this.searchData.baoFeiStatus=='即将报废'){
this.searchData.IsLjBaoFeiDay="10";
}else{
this.searchData.IsLjBaoFeiDay='0';
}
//this.searchData.baoFeiStatus=this.searchData.baoFeiStatus;
console.log(this.searchData.baoFeiStatus)
},
// //即将报废切换
// baoFeiChang(){
// if(this.baoFeiDay=="2"){
// this.searchData.IsLjBaoYang='';
// this.searchData.IsLjBaoFeiDay=10;
// this.getQueuData(1);
// // console.log("10")
// }else{
// this.searchData.IsLjBaoYang='';
// this.searchData.IsLjBaoFeiDay=0;
// this.getQueuData(1);
// // console.log("0")
// }
// },
// toBaoFDaysTx(){
// if(this.days=='10'){
// this.searchData.IsLjBaoYang='';
// this.searchData.IsLjBaoFeiDay=10;
// this.getQueuData(1);
// //console.log("10")
// }else{
// this.searchData.IsLjBaoYang='';
// this.searchData.IsLjBaoFeiDay=30;
// this.getQueuData(1);
// //console.log("30")
// }
// },
//查看信息
async equCheck(row) {
this.borrowTableVisible = true;
const borrowUrl = "/api/Equipment/" + row.ID;
const { data: res } = await this.$axios.get(borrowUrl);
if (res.Success == false) return this.$message(res.Remark);
this.detailData = res;
//console.log("ro",row)
this.videoUrl=row.VideoUrl;
this.videoUrlSrc=window._CONFIG['dlURL']+'/'+this.videoUrl;
},
//报废
async baoFei(row){
const equFormData = new FormData();
equFormData.append("ID", row.ID);
equFormData.append("State", 3);
const config = {
headers: {
"Content-Type": "multipart/form-data",
},
};
const url = "/api/Equipment/UpdateEquOutInState";
this.$confirm("报废该装备 ?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
const { data: res } = await this.$axios.post(url,equFormData,config);
if (res.Success === true) {
//this.getQueuData();
this.searchData.IsLjBaoYang='';
this.searchData.IsLjBaoFeiDay=10;
this.getQueuData(1);
this.$message.success("操作成功!");
//刷新查看
this.check(this.row)
} else {
this.$message.error("操作失败!");
}
})
.catch((e) => {
//this.$message.warning("已取消该操作!");
});
//console.log('报废成功')
},
// 获取当前选中部门的名称
async selectDepart(node) {
//console.log(node);
this.AddBaoyangForm.parentName = node.DepartName;
this.AddBaoyangForm.parentId = node.ID;
this.searchUserData.DeparId = node.ID;
const { data: res } = await this.$axios.get("api/User", {
params: this.searchUserData,
});
this.policeOptions = res.Rows;
},
///人员选择
policeSelect(row) {
var obj = {};
obj = this.policeOptions.find(function (item) {
return item.ID === row;
});
//console.log(obj)
this.ruleBaoYangForm.BaoyangPersonId =obj.ID;
this.ruleBaoYangForm.BaoyangPersonName =obj.UserName;
},
// 每页显示条数发生改变时
handleSizeChange(val) {
this.searchData.Rows = val;
this.getQueuData();
},
// 当前页数发生改变时
handleCurrentChange(val) {
this.searchData.Page = val;
this.getQueuData();
},
},
watch:{
'$router':'handleClick'
},
};
</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;
}
.labelBorrow {
margin: auto;
font-weight: bold;
font-size: 16px;
}
.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;
}
.title_box {
margin-top: 0px;
}
.textboxBo {
margin-right: 16px;
float: left;
margin-bottom: 13px;
}
.logo {
margin-top: -4px;
margin-left: 29px;
}
</style>
......@@ -18,7 +18,7 @@
>首页</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
>
</el-row>
......@@ -60,7 +60,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -127,6 +127,17 @@
>
</template>
</el-table-column>
<el-table-column label="模块灯开关" width="160" align="center">
<template v-slot="scope">
<el-switch
v-model="scope.row.isOpen"
@change="changeMLight(scope.row)"
:active-isOpen="true"
:inactive-isOpen="false"
>
</el-switch>
</template>
</el-table-column>
</el-table>
<el-dialog
width="70%"
......@@ -386,8 +397,8 @@
</template>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="baseTableVisible = false"
>确 定</el-button
<el-button @click="baseTableVisible = false"
>关 闭</el-button
>
</div>
</el-dialog>
......@@ -505,6 +516,7 @@ export default {
history_Num: "",
// 总条数
total: 0,
isOpen: true,
};
},
......@@ -577,27 +589,25 @@ export default {
}
});
},
//改变预案停启用状态
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
//改变mk灯光状态
async changeMLight(row){
//console.log('改变灯光状态')
this.id=row.ID;
this.isOpen=row.isOpen;
//console.log('kd'+ this.ID +this.isOpen)
const { data: res } = await this.$axios.post("api/PlanModel/ControlStorageLight",
{id:this.id,isOpen:this.isOpen}
);
if (res.Success !== true) return this.$message(res.message);
this.getQueuData();
if (res.Success !== true) return this.$message.error(res.Remark);
// 提交信息成功后要关闭对话框,并且刷新数据
if(this.isOpen==true){
this.$message.success("灯光已打开,若未手动开闭,5分钟后自动关闭!");
}else{
this.$message.success("已手动开闭!");
}
},
//修改
async edit(row) {
......@@ -631,7 +641,7 @@ export default {
}
})
.catch((e) => {
this.$message.error("已取消删除");
this.$message.warning("已取消删除");
});
},
///获取物料内容
......@@ -686,7 +696,10 @@ export default {
});
this.classOption = resclass.Rows;
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/PlanModel", {
params: this.searchData,
......
......@@ -60,7 +60,7 @@
icon="search"
style="height: 40px"
class="textboxBo"
@click="getQueuData()"
@click="getQueuData(1)"
>查询</a-button
>
<el-button
......@@ -118,6 +118,15 @@
@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>
......@@ -309,7 +318,7 @@ export default {
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
} else {//修改仓库类型
// console.log(this.ruleForm.ID)
formData.append("ID", this.ruleForm.ID);
......@@ -318,7 +327,7 @@ export default {
formData,
config
);
if (res.Success !== true) return this.$message(res.message);
if (res.Success !== true) return this.$message(res.Remark);
}
this.getQueuData();
this.addVisible = false;
......@@ -335,6 +344,27 @@ export default {
this.ruleForm.LibaryType=JSON.parse(JSON.stringify(row.LibaryTypeName));
console.log(this.ruleForm)
},
//删除仓库
deleteClick(row) {
const url = "/api/Libary/" + 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("已删除该数据");
} else {
this.$message.error(res.Remark);
}
})
.catch((e) => {
this.$message.warning("已取消删除");
});
},
//查看照片
watchPic() {},
clickLI(id) {
......@@ -359,7 +389,10 @@ export default {
// this.$nextTick(()=>{
// this.resetForm('ruleForm')})
},
async getQueuData() {
async getQueuData(arg) {
if(arg) {
this.searchData.Page = 1
}
this.loading = true;
const { data: res } = await this.$axios.get("api/Libary", {
params: this.searchData,
......
......@@ -261,9 +261,9 @@
</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
<!-- <el-button @click="borrowTableVisible = false">取 消</el-button> -->
<el-button @click="borrowTableVisible = false"
>关 闭</el-button
>
</div>
</el-dialog>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论