This commit is contained in:
xd 2024-03-15 11:00:31 +08:00
parent 1854f03167
commit 0009e18205
5 changed files with 457 additions and 390 deletions

View File

@ -84,7 +84,7 @@ public class storageLocationController extends BaseController
@PostMapping("/checkStorageLocation") @PostMapping("/checkStorageLocation")
public AjaxResult checkStorageLocation(@RequestBody StorageLocation storageLocation) public AjaxResult checkStorageLocation(@RequestBody StorageLocation storageLocation)
{ {
String storageExpire = configService.selectConfigByKey("storage.expire"); String storageExpire = configService.selectConfigByKey("storage.expire.zy");
String user_name = getLoginUser().getUsername();//当前登陆者 String user_name = getLoginUser().getUsername();//当前登陆者
String materialBh = storageLocation.getMaterialBh(); String materialBh = storageLocation.getMaterialBh();
@ -105,8 +105,6 @@ public class storageLocationController extends BaseController
@PostMapping("/cancelStorageLocation") @PostMapping("/cancelStorageLocation")
public AjaxResult cancelStorageLocation(@RequestBody StorageLocation storageLocation) public AjaxResult cancelStorageLocation(@RequestBody StorageLocation storageLocation)
{ {
String storageExpire = configService.selectConfigByKey("storage.expire");
String user_name = getLoginUser().getUsername();//当前登陆者 String user_name = getLoginUser().getUsername();//当前登陆者
String materialBh = storageLocation.getMaterialBh(); String materialBh = storageLocation.getMaterialBh();

View File

@ -13,6 +13,7 @@ public class StorageLocation extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String materialBh; private String materialBh;
private String materialZlh;
private String materialXingh; private String materialXingh;
private String materialGuig; private String materialGuig;
private String materialDiany; private String materialDiany;
@ -27,6 +28,14 @@ public class StorageLocation extends BaseEntity
this.materialBh = materialBh; this.materialBh = materialBh;
} }
public String getMaterialZlh() {
return materialZlh;
}
public void setMaterialZlh(String materialZlh) {
this.materialZlh = materialZlh;
}
public String getMaterialXingh() { public String getMaterialXingh() {
return materialXingh; return materialXingh;
} }

View File

@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="StorageLocation" id="StorageLocationResult"> <resultMap type="StorageLocation" id="StorageLocationResult">
<result property="materialBh" column="materialBh" /> <result property="materialBh" column="materialBh" />
<result property="materialZlh" column="materialZlh" />
<result property="materialXingh" column="materialXingh" /> <result property="materialXingh" column="materialXingh" />
<result property="materialGuig" column="materialGuig" /> <result property="materialGuig" column="materialGuig" />
<result property="materialDiany" column="materialDiany" /> <result property="materialDiany" column="materialDiany" />
@ -14,21 +15,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<select id="selectStorageLocationAList" parameterType="StorageLocation" resultMap="StorageLocationResult"> <select id="selectStorageLocationAList" parameterType="StorageLocation" resultMap="StorageLocationResult">
select materialBh, materialXingh, materialGuig, materialDiany, materialMs, materialState select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState
from storageLocation where materialBh like 'A%' from storageLocation where materialBh like 'A%'
</select> </select>
<select id="selectStorageLocationBList" parameterType="StorageLocation" resultMap="StorageLocationResult"> <select id="selectStorageLocationBList" parameterType="StorageLocation" resultMap="StorageLocationResult">
select materialBh, materialXingh, materialGuig, materialDiany, materialMs, materialState select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState
from storageLocation where materialBh like 'B%' from storageLocation where materialBh like 'B%'
</select> </select>
<select id="selectStorageLocationCList" parameterType="StorageLocation" resultMap="StorageLocationResult"> <select id="selectStorageLocationCList" parameterType="StorageLocation" resultMap="StorageLocationResult">
select materialBh, materialXingh, materialGuig, materialDiany, materialMs, materialState select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState
from storageLocation where materialBh like 'C%' from storageLocation where materialBh like 'C%'
</select> </select>
<update id="addStorageLocation" parameterType="StorageLocation"> <update id="addStorageLocation" parameterType="StorageLocation">
update storageLocation update storageLocation
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="materialZlh != null and materialZlh != ''">materialZlh = #{materialZlh},</if>
<if test="materialXingh != null and materialXingh != ''">materialXingh = #{materialXingh},</if> <if test="materialXingh != null and materialXingh != ''">materialXingh = #{materialXingh},</if>
<if test="materialGuig != null and materialGuig != ''">materialGuig = #{materialGuig},</if> <if test="materialGuig != null and materialGuig != ''">materialGuig = #{materialGuig},</if>
<if test="materialDiany != null and materialDiany != ''">materialDiany = #{materialDiany},</if> <if test="materialDiany != null and materialDiany != ''">materialDiany = #{materialDiany},</if>

View File

@ -1,202 +1,240 @@
<template> <template>
<div style="margin-top: 5px;">
<div style="margin-left: 5px; margin-right: 5px;"> <el-tabs v-model="activeName" @tab-click="handleClick" style="margin-left: 15px; margin-right: 15px;">
<el-row :gutter="10" style="letter-spacing: 5px;"> <el-tab-pane label="库位查看" name="locationShow">
<el-col :span="8"> <el-row :gutter="10" style="letter-spacing: 5px;">
<div class="grid-content bg-purpleA">黄色线芯A区({{countA}})</div> <el-col :span="8">
</el-col> <div class="grid-content bg-purpleA">黄色线芯A区({{countA}})</div>
<el-col :span="8"> </el-col>
<div class="grid-content bg-purpleB">绿色线芯B区({{countB}})</div> <el-col :span="8">
</el-col> <div class="grid-content bg-purpleB">绿色线芯B区({{countB}})</div>
<el-col :span="8"> </el-col>
<div class="grid-content bg-purpleC">红色线芯C区({{countC}})</div> <el-col :span="8">
</el-col> <div class="grid-content bg-purpleC">红色线芯C区({{countC}})</div>
</el-row> </el-col>
<el-row :gutter="10"> </el-row>
<el-col :span="8"> <el-row :gutter="10">
<el-card class="box-card scrollable"> <el-col :span="8">
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :15px'" v-for="(item,index) in materialDetailA" :key="item.materialBh"> <el-card class="box-card scrollable">
<el-descriptions-item> <el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :15px'" v-for="(item,index) in materialDetailA" :key="item.materialBh">
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
库位 <template slot="label">
</template> 库位
<span class="kw">{{item.materialBh}}</span> </template>
</el-descriptions-item> <span class="kw">{{item.materialBh}}</span>
<el-descriptions-item :contentStyle="{'text-align': 'center'}"> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
状态 <template slot="label">
</template> 状态
<span v-if = "item.materialState=='0'"> </template>
<el-tag size="mini" type="success" @click="openDialog(item)">空闲</el-tag> <span v-if = "item.materialState=='0'">
</span> <el-tag size="mini" type="success">空闲</el-tag>
<span v-if = "item.materialState=='1'"> </span>
<el-tag size="mini" type="danger">占用</el-tag> <span v-if = "item.materialState=='1'">
</span> <el-tag size="mini" type="danger" @click="selectLocation(item)">占用</el-tag>
</el-descriptions-item> </span>
<el-descriptions-item :span="2"> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
型号 <template slot="label">
</template> 指令号
{{item.materialXingh}} </template>
</el-descriptions-item> {{item.materialZlh}}
<el-descriptions-item :span="2"> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
规格 <template slot="label">
</template> 型号
{{item.materialGuig}} </template>
</el-descriptions-item> {{item.materialXingh}}
<el-descriptions-item> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
电压等级 <template slot="label">
</template> 规格
{{item.materialDiany}} </template>
</el-descriptions-item> {{item.materialGuig}}
<el-descriptions-item> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
米数 <template slot="label">
</template> 电压等级
{{item.materialMs}} </template>
</el-descriptions-item> {{item.materialDiany}}
</el-descriptions> </el-descriptions-item>
</el-card> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
</el-col> <template slot="label">
<el-col :span="8"> 米数
<el-card class="box-card scrollable"> </template>
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in materialDetailB" :key="item.materialBh"> {{item.materialMs}}
<el-descriptions-item> </el-descriptions-item>
<template slot="label"> </el-descriptions>
库位 </el-card>
</template> </el-col>
<span class="kw">{{item.materialBh}}</span> <el-col :span="8">
</el-descriptions-item> <el-card class="box-card scrollable">
<el-descriptions-item :contentStyle="{'text-align': 'center'}"> <el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in materialDetailB" :key="item.materialBh">
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
状态 <template slot="label">
</template> 库位
<span v-if = "item.materialState=='0'"> </template>
<el-tag size="mini" type="success" @click="openDialog(item)">空闲</el-tag> <span class="kw">{{item.materialBh}}</span>
</span> </el-descriptions-item>
<span v-if = "item.materialState=='1'"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<el-tag size="mini" type="danger">占用</el-tag> <template slot="label">
</span> 状态
</el-descriptions-item> </template>
<el-descriptions-item :span="2"> <span v-if = "item.materialState=='0'">
<template slot="label"> <el-tag size="mini" type="success">空闲</el-tag>
型号 </span>
</template> <span v-if = "item.materialState=='1'">
{{item.materialXingh}} <el-tag size="mini" type="danger">占用</el-tag>
</el-descriptions-item> </span>
<el-descriptions-item :span="2"> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
规格 <template slot="label">
</template> 指令号
{{item.materialGuig}} </template>
</el-descriptions-item> {{item.materialZlh}}
<el-descriptions-item> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
电压等级 <template slot="label">
</template> 型号
{{item.materialDiany}} </template>
</el-descriptions-item> {{item.materialXingh}}
<el-descriptions-item> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
米数 <template slot="label">
</template> 规格
{{item.materialMs}} </template>
</el-descriptions-item> {{item.materialGuig}}
</el-descriptions> </el-descriptions-item>
</el-card> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
</el-col> <template slot="label">
<el-col :span="8"> 电压等级
<el-card class="box-card scrollable"> </template>
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in materialDetailC" :key="item.materialBh"> {{item.materialDiany}}
<el-descriptions-item> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
库位 <template slot="label">
</template> 米数
<span class="kw">{{item.materialBh}}</span> </template>
</el-descriptions-item> {{item.materialMs}}
<el-descriptions-item :contentStyle="{'text-align': 'center'}"> </el-descriptions-item>
<template slot="label"> </el-descriptions>
状态 </el-card>
</template> </el-col>
<span v-if = "item.materialState=='0'"> <el-col :span="8">
<el-tag size="mini" type="success" @click="openDialog(item)">空闲</el-tag> <el-card class="box-card scrollable">
</span> <el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in materialDetailC" :key="item.materialBh">
<span v-if = "item.materialState=='1'"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<el-tag size="mini" type="danger">占用</el-tag> <template slot="label">
</span> 库位
</el-descriptions-item> </template>
<el-descriptions-item :span="2"> <span class="kw">{{item.materialBh}}</span>
<template slot="label"> </el-descriptions-item>
型号 <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
</template> <template slot="label">
{{item.materialXingh}} 状态
</el-descriptions-item> </template>
<el-descriptions-item :span="2"> <span v-if = "item.materialState=='0'">
<template slot="label"> <el-tag size="mini" type="success">空闲</el-tag>
规格 </span>
</template> <span v-if = "item.materialState=='1'">
{{item.materialGuig}} <el-tag size="mini" type="danger">占用</el-tag>
</el-descriptions-item> </span>
<el-descriptions-item> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
电压等级 <template slot="label">
</template> 指令号
{{item.materialDiany}} </template>
</el-descriptions-item> {{item.materialZlh}}
<el-descriptions-item> </el-descriptions-item>
<template slot="label"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
米数 <template slot="label">
</template> 型号
{{item.materialMs}} </template>
</el-descriptions-item> {{item.materialXingh}}
</el-descriptions> </el-descriptions-item>
</el-card> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
</el-col> <template slot="label">
</el-row> 规格
</div> </template>
<!-- 添加或修改材料管理对话框 --> {{item.materialGuig}}
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> </el-descriptions-item>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<el-row> <template slot="label">
<el-col :span="12"> 电压等级
<el-form-item label="库位" prop="materialBh"> </template>
<el-input v-model="form.materialBh"/> {{item.materialDiany}}
</el-form-item> </el-descriptions-item>
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label">
米数
</template>
{{item.materialMs}}
</el-descriptions-item>
</el-descriptions>
</el-card>
</el-col>
</el-row>
<!-- 添加或修改材料管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="库位" prop="materialBh">
<el-input v-model="form.materialBh" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="指令号" prop="materialZlh">
<el-input v-model="form.materialZlh"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="型号" prop="materialXingh">
<el-input v-model="form.materialXingh" placeholder="请输入型号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="materialGuig">
<el-input v-model="form.materialGuig" placeholder="请输入规格"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="电压等级" prop="materialDiany">
<el-input v-model="form.materialDiany" placeholder="请输入电压等级" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="米数" prop="materialMs">
<el-input v-model="form.materialMs" placeholder="请输入米数" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</el-tab-pane>
<el-tab-pane label="已选库位" name="locationSelected">
<el-row :gutter="10" style="letter-spacing: 5px;">
<el-col :span="8">
<div class="grid-content bg-purpleA">黄色线芯A区({{countA}})</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purpleB">绿色线芯B区({{countB}})</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purpleC">红色线芯C区({{countC}})</div>
</el-col> </el-col>
</el-row> </el-row>
<el-row> </el-tab-pane>
<el-col :span="12"> </el-tabs>
<el-form-item label="型号" prop="materialXingh">
<el-input v-model="form.materialXingh" placeholder="请输入型号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="materialGuig">
<el-input v-model="form.materialGuig" placeholder="请输入规格"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="电压等级" prop="materialDiany">
<el-input v-model="form.materialDiany" placeholder="请输入电压等级" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="米数" prop="materialMs">
<el-input v-model="form.materialMs" placeholder="请输入米数" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template> </template>
<style> <style>
/*库位号样式*/ /*库位号样式*/
@ -204,13 +242,18 @@
font-size: 15px;color: black;font-weight: bold font-size: 15px;color: black;font-weight: bold
} }
/* 修改标签本身的样式 */
.el-tag:hover {
cursor: pointer; /* 将鼠标形状改为指针形状 */
}
/*卡片内容滚动条设置*/ /*卡片内容滚动条设置*/
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; /* Chrome Safari */ display: none; /* Chrome Safari */
} }
.scrollable{ .scrollable{
overflow: auto; /* 自动开启滚动条 */ overflow: auto; /* 自动开启滚动条 */
max-height: 650px; /* 设置最大高度 */ max-height: 580px; /* 设置最大高度 */
} }
/*最上方三大块样式*/ /*最上方三大块样式*/
@ -241,148 +284,157 @@
import { listStorageLocation, addStorageLocation, checkStorageLocation,cancelStorageLocation } from "@/api/storageLocation/storageLocation"; import { listStorageLocation, addStorageLocation, checkStorageLocation,cancelStorageLocation } from "@/api/storageLocation/storageLocation";
export default { export default {
name: "locationConsuming", name: "locationConsuming.vue",
data() { data() {
return { return {
queryParams: { activeName: 'locationShow',
materialBh: null,
materialXingh: null,
materialGuig: null,
materialDiany: null,
materialMs: null
},
// //
title: "", contentStyle: {
// 'text-align': 'center',
open: false, 'width': '150px'
// },
materialDetailA:[], //label
materialDetailB:[], labelStyle: { 'width': '80px' },
materialDetailC:[],
//
form: {},
//
rules: {
materialXingh: [
{ required: true, message: "型号不能为空", trigger: "blur" }
],
materialGuig: [
{ required: true, message: "规格不能为空", trigger: "blur" }
],
materialDiany: [
{ required: true, message: "电压等级不能为空", trigger: "blur" }
],
materialMs: [
{ required: true, message: "米数不能为空", trigger: "blur" }
],
},
//线
/* materialDetailA: [{materialBh:'A-1', materialXingh: 'YJV', materialGuig: '1*10', materialDiany: '1kV', materialMs: '1.5', materialState:'0'},
{materialBh:'A-2',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'0'},
{materialBh:'A-3',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'A-4',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'A-5',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'A-6',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'0'},
{materialBh:'A-7',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'A-8',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'}],
materialDetailB: [{materialBh:'B-1',materialXingh: 'YJV', materialGuig: '1*10', materialDiany: '1kV', materialMs: '1.5', materialState:'1'}, queryParams: {
{materialBh:'B-2',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'0'}, materialBh: null,
{materialBh:'B-3',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'}, materialZlh: null,
{materialBh:'B-4',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'}, materialXingh: null,
{materialBh:'B-5',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'}, materialGuig: null,
{materialBh:'B-6',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'0'}, materialDiany: null,
{materialBh:'B-7',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'}, materialMs: null
{materialBh:'B-8',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'}],
materialDetailC: [{materialBh:'C-1',materialXingh: 'YJV', materialGuig: '1*10', materialDiany: '1kV', materialMs: '1.5', materialState:'0'},
{materialBh:'C-2',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'1'},
{materialBh:'C-3',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'C-4',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'C-5',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'C-6',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'1'},
{materialBh:'C-7',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'C-8',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'}],*/
}
},
created() {
/*获取库位信息*/
this.getStorageLocation();
},
computed:{
countA(){
// 使 find
return this.materialDetailA.filter(task => task.materialState === '0').length;
},
countB(){
// 使 find
return this.materialDetailB.filter(task => task.materialState === '0').length;
},
countC(){
// 使 find
return this.materialDetailC.filter(task => task.materialState === '0').length;
}
},
methods: {
/*获取库位信息*/
getStorageLocation(){
listStorageLocation(this.queryParams).then(response => {
this.materialDetailA = response.materialDetailA;
this.materialDetailB = response.materialDetailB;
this.materialDetailC = response.materialDetailC;
});
}, },
/** 打开录入弹窗 */ //
openDialog(item) { title: "",
// //
this.form.materialBh = item.materialBh; open: false,
checkStorageLocation(this.form).then(response => { //
this.reset(); materialDetailA:[],
this.open = true; materialDetailB:[],
this.title = "录入信息"; materialDetailC:[],
this.form.materialBh = item.materialBh; //
}).catch((error) => { form: {},
console.error(error); //
}); rules: {
}, materialZlh: [
{ required: true, message: "指令号不能为空", trigger: "blur" }
/** 提交按钮 */ ],
submitForm() { materialXingh: [
this.$refs["form"].validate(valid => { { required: true, message: "型号不能为空", trigger: "blur" }
if (valid) { ],
addStorageLocation(this.form).then(response => { materialGuig: [
this.$modal.msgSuccess("录入成功"); { required: true, message: "规格不能为空", trigger: "blur" }
this.open = false; ],
this.getStorageLocation(); materialDiany: [
}); { required: true, message: "电压等级不能为空", trigger: "blur" }
} ],
}); materialMs: [
}, { required: true, message: "米数不能为空", trigger: "blur" }
],
//
cancel() {
cancelStorageLocation(this.form).then(response => {
this.open = false;
this.reset();
}).catch((error) => {
console.error(error);
});
},
//
reset() {
this.form = {
materialBh: null,
materialXingh: null,
materialGuig: null,
materialDiany: null,
materialMs: null
};
this.resetForm("form");
} }
} }
},
created() {
/*获取库位信息*/
this.getStorageLocation();
},
computed:{
countA(){
// 使 find
return this.materialDetailA.filter(task => task.materialState === '0').length;
},
countB(){
// 使 find
return this.materialDetailB.filter(task => task.materialState === '0').length;
},
countC(){
// 使 find
return this.materialDetailC.filter(task => task.materialState === '0').length;
}
},
methods: {
/*获取库位信息*/
getStorageLocation(){
listStorageLocation(this.queryParams).then(response => {
this.materialDetailA = response.materialDetailA;
this.materialDetailB = response.materialDetailB;
this.materialDetailC = response.materialDetailC;
});
},
/** 打开录入弹窗 */
openDialog(item) {
//
this.form.materialBh = item.materialBh;
checkStorageLocation(this.form).then(response => {
this.reset();
this.open = true;
this.title = "录入信息";
this.form.materialBh = item.materialBh;
}).catch((error) => {
console.error(error);
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
addStorageLocation(this.form).then(response => {
this.$modal.msgSuccess("录入成功");
this.open = false;
this.getStorageLocation();
});
}
});
},
//
cancel() {
cancelStorageLocation(this.form).then(response => {
this.open = false;
this.reset();
}).catch((error) => {
console.error(error);
});
},
//
reset() {
this.form = {
materialBh: null,
materialZlh: null,
materialXingh: null,
materialGuig: null,
materialDiany: null,
materialMs: null
};
this.resetForm("form");
},
/*===============================================领用操作==========================================*/
// Tag
handleClick(tab, event) {
console.log(tab, event);
},
//
selectLocation(item){
this.$confirm("是否选择该 "+item.materialBh+" 库位?","提示",{
iconClass: "el-icon-question",//
confirmButtonText: "确认",//
cancelButtonText: "取消",//
showClose: false,//
type: "warning",// success/info/warning/error
}).then(()=>{
//
}).catch(() => {
//
});
}
} }
}
</script> </script>

View File

@ -16,13 +16,13 @@
<el-col :span="8"> <el-col :span="8">
<el-card class="box-card scrollable"> <el-card class="box-card scrollable">
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :15px'" v-for="(item,index) in materialDetailA" :key="item.materialBh"> <el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :15px'" v-for="(item,index) in materialDetailA" :key="item.materialBh">
<el-descriptions-item :labelStyle='labelStyle'> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
库位 库位
</template> </template>
<span class="kw">{{item.materialBh}}</span> <span class="kw">{{item.materialBh}}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :labelStyle='labelStyle' :contentStyle="{'text-align': 'center'}"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
状态 状态
</template> </template>
@ -33,25 +33,31 @@
<el-tag size="mini" type="danger">占用</el-tag> <el-tag size="mini" type="danger">占用</el-tag>
</span> </span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :labelStyle='labelStyle'> <el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label">
指令号
</template>
{{item.materialZlh}}
</el-descriptions-item>
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
型号 型号
</template> </template>
{{item.materialXingh}} {{item.materialXingh}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :labelStyle='labelStyle'> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
规格 规格
</template> </template>
{{item.materialGuig}} {{item.materialGuig}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :labelStyle='labelStyle'> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
电压等级 电压等级
</template> </template>
{{item.materialDiany}} {{item.materialDiany}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :labelStyle='labelStyle'> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
米数 米数
</template> </template>
@ -63,13 +69,13 @@
<el-col :span="8"> <el-col :span="8">
<el-card class="box-card scrollable"> <el-card class="box-card scrollable">
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in materialDetailB" :key="item.materialBh"> <el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in materialDetailB" :key="item.materialBh">
<el-descriptions-item> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
库位 库位
</template> </template>
<span class="kw">{{item.materialBh}}</span> <span class="kw">{{item.materialBh}}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :contentStyle="{'text-align': 'center'}"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
状态 状态
</template> </template>
@ -80,25 +86,31 @@
<el-tag size="mini" type="danger">占用</el-tag> <el-tag size="mini" type="danger">占用</el-tag>
</span> </span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2"> <el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label">
指令号
</template>
{{item.materialZlh}}
</el-descriptions-item>
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
型号 型号
</template> </template>
{{item.materialXingh}} {{item.materialXingh}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
规格 规格
</template> </template>
{{item.materialGuig}} {{item.materialGuig}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
电压等级 电压等级
</template> </template>
{{item.materialDiany}} {{item.materialDiany}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
米数 米数
</template> </template>
@ -110,13 +122,13 @@
<el-col :span="8"> <el-col :span="8">
<el-card class="box-card scrollable"> <el-card class="box-card scrollable">
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in materialDetailC" :key="item.materialBh"> <el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in materialDetailC" :key="item.materialBh">
<el-descriptions-item> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
库位 库位
</template> </template>
<span class="kw">{{item.materialBh}}</span> <span class="kw">{{item.materialBh}}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :contentStyle="{'text-align': 'center'}"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
状态 状态
</template> </template>
@ -127,25 +139,31 @@
<el-tag size="mini" type="danger">占用</el-tag> <el-tag size="mini" type="danger">占用</el-tag>
</span> </span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2"> <el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label">
指令号
</template>
{{item.materialZlh}}
</el-descriptions-item>
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
型号 型号
</template> </template>
{{item.materialXingh}} {{item.materialXingh}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2"> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
规格 规格
</template> </template>
{{item.materialGuig}} {{item.materialGuig}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
电压等级 电压等级
</template> </template>
{{item.materialDiany}} {{item.materialDiany}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
<template slot="label"> <template slot="label">
米数 米数
</template> </template>
@ -162,7 +180,12 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="库位" prop="materialBh"> <el-form-item label="库位" prop="materialBh">
<el-input v-model="form.materialBh"/> <el-input v-model="form.materialBh" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="指令号" prop="materialZlh">
<el-input v-model="form.materialZlh"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -203,13 +226,14 @@
.kw{ .kw{
font-size: 15px;color: black;font-weight: bold font-size: 15px;color: black;font-weight: bold
} }
/*卡片内容滚动条设置*/ /*卡片内容滚动条设置*/
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; /* Chrome Safari */ display: none; /* Chrome Safari */
} }
.scrollable{ .scrollable{
overflow: auto; /* 自动开启滚动条 */ overflow: auto; /* 自动开启滚动条 */
max-height: 650px; /* 设置最大高度 */ max-height: 600px; /* 设置最大高度 */
} }
/*最上方三大块样式*/ /*最上方三大块样式*/
@ -243,12 +267,17 @@
name: "locationSet", name: "locationSet",
data() { data() {
return { return {
//
contentStyle: {
'text-align': 'center',
'width': '150px'
},
//label //label
labelStyle: { 'width': '100px' }, labelStyle: { 'width': '80px' },
queryParams: { queryParams: {
materialBh: null, materialBh: null,
materialZlh: null,
materialXingh: null, materialXingh: null,
materialGuig: null, materialGuig: null,
materialDiany: null, materialDiany: null,
@ -267,6 +296,9 @@
form: {}, form: {},
// //
rules: { rules: {
materialZlh: [
{ required: true, message: "指令号不能为空", trigger: "blur" }
],
materialXingh: [ materialXingh: [
{ required: true, message: "型号不能为空", trigger: "blur" } { required: true, message: "型号不能为空", trigger: "blur" }
], ],
@ -279,34 +311,7 @@
materialMs: [ materialMs: [
{ required: true, message: "米数不能为空", trigger: "blur" } { required: true, message: "米数不能为空", trigger: "blur" }
], ],
}, }
//线
/* materialDetailA: [{materialBh:'A-1', materialXingh: 'YJV', materialGuig: '1*10', materialDiany: '1kV', materialMs: '1.5', materialState:'0'},
{materialBh:'A-2',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'0'},
{materialBh:'A-3',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'A-4',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'A-5',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'A-6',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'0'},
{materialBh:'A-7',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'A-8',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'}],
materialDetailB: [{materialBh:'B-1',materialXingh: 'YJV', materialGuig: '1*10', materialDiany: '1kV', materialMs: '1.5', materialState:'1'},
{materialBh:'B-2',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'0'},
{materialBh:'B-3',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'B-4',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'B-5',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'B-6',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'0'},
{materialBh:'B-7',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'B-8',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'}],
materialDetailC: [{materialBh:'C-1',materialXingh: 'YJV', materialGuig: '1*10', materialDiany: '1kV', materialMs: '1.5', materialState:'0'},
{materialBh:'C-2',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'1'},
{materialBh:'C-3',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'C-4',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'},
{materialBh:'C-5',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'C-6',materialXingh: 'YJV2', materialGuig: '2*10', materialDiany: '2kV', materialMs: '2.5', materialState:'1'},
{materialBh:'C-7',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'0'},
{materialBh:'C-8',materialXingh: 'YJV3', materialGuig: '3*10', materialDiany: '3kV', materialMs: '3.5', materialState:'1'}],*/
} }
}, },
created() { created() {
@ -379,6 +384,7 @@
reset() { reset() {
this.form = { this.form = {
materialBh: null, materialBh: null,
materialZlh: null,
materialXingh: null, materialXingh: null,
materialGuig: null, materialGuig: null,
materialDiany: null, materialDiany: null,