代码优化
This commit is contained in:
parent
f40a8a5119
commit
9bfcacb4df
|
|
@ -1,21 +1,12 @@
|
|||
<template>
|
||||
<div class="app-container" id="secondStore">
|
||||
<div
|
||||
class="upper-sec"
|
||||
>
|
||||
<div
|
||||
:class="[{ clicked: leaseType == 1 }]"
|
||||
@click="toggleBtn(1)"
|
||||
>
|
||||
长期领用
|
||||
</div>
|
||||
<div
|
||||
:class="[{ clicked: leaseType == 0 }]"
|
||||
@click="toggleBtn(0)"
|
||||
|
||||
>
|
||||
工程领用
|
||||
</div>
|
||||
<div class="upper-sec">
|
||||
<div :class="[{ clicked: leaseType == 1 }]" @click="toggleBtn(1)">
|
||||
长期领用
|
||||
</div>
|
||||
<div :class="[{ clicked: leaseType == 0 }]" @click="toggleBtn(0)">
|
||||
工程领用
|
||||
</div>
|
||||
</div>
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
|
|
@ -166,7 +157,6 @@
|
|||
label="工程名称"
|
||||
align="center"
|
||||
key="3"
|
||||
|
||||
prop="proName"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="leaseType == 0"
|
||||
|
|
@ -175,49 +165,43 @@
|
|||
label="类型名称"
|
||||
align="center"
|
||||
key="4"
|
||||
|
||||
prop="typeName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
key="5"
|
||||
|
||||
prop="modelName"
|
||||
:show-overflow-tooltip="true"
|
||||
label="规格型号"
|
||||
align="center"
|
||||
key="5"
|
||||
prop="modelName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="计量单位"
|
||||
align="center"
|
||||
key="6"
|
||||
|
||||
prop="nuitName"
|
||||
:show-overflow-tooltip="true"
|
||||
label="计量单位"
|
||||
align="center"
|
||||
key="6"
|
||||
prop="nuitName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="总量"
|
||||
align="center"
|
||||
key="7"
|
||||
|
||||
prop="num"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="leaseType == 1"
|
||||
label="总量"
|
||||
align="center"
|
||||
key="7"
|
||||
prop="num"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="leaseType == 1"
|
||||
/>
|
||||
<el-table-column
|
||||
label="库存数量"
|
||||
align="center"
|
||||
key="8"
|
||||
|
||||
prop="stockNum"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="leaseType == 1"
|
||||
label="库存数量"
|
||||
align="center"
|
||||
key="8"
|
||||
prop="stockNum"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="leaseType == 1"
|
||||
/>
|
||||
<el-table-column
|
||||
label="领用数量"
|
||||
align="center"
|
||||
key="9"
|
||||
|
||||
prop="receiveNum"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="leaseType == 1"
|
||||
|
|
@ -231,21 +215,19 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="在用数量"
|
||||
align="center"
|
||||
key="10"
|
||||
|
||||
prop="receiveNum"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="leaseType == 0"
|
||||
label="在用数量"
|
||||
align="center"
|
||||
key="10"
|
||||
prop="receiveNum"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="leaseType == 0"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
key="11"
|
||||
|
||||
width="150"
|
||||
v-if="leaseType == 1"
|
||||
label="操作"
|
||||
align="center"
|
||||
key="11"
|
||||
width="150"
|
||||
v-if="leaseType == 1"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -273,11 +255,10 @@
|
|||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
@pagination="getList(leaseType)"
|
||||
/>
|
||||
|
||||
<!-- 出库弹窗 -->
|
||||
|
|
@ -318,9 +299,9 @@
|
|||
|
||||
<el-form-item label="出库数量" prop="outNum">
|
||||
<el-input
|
||||
v-model="form.outNum"
|
||||
placeholder="请输入出库数量"
|
||||
maxlength="20"
|
||||
v-model="form.outNum"
|
||||
placeholder="请输入出库数量"
|
||||
maxlength="20"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="teamName">
|
||||
|
|
@ -383,12 +364,9 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="领用数量" prop="ckNum">
|
||||
<el-input
|
||||
v-model="nform.ckNum"
|
||||
disabled
|
||||
/>
|
||||
<el-input v-model="nform.ckNum" disabled />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="已出库数量" prop="ckNum">
|
||||
<!-- <el-form-item label="已出库数量" prop="ckNum">
|
||||
<el-input v-model="nform.ckNum" disabled />
|
||||
</el-form-item>-->
|
||||
|
||||
|
|
@ -437,7 +415,7 @@
|
|||
width="1200px"
|
||||
append-to-body
|
||||
>
|
||||
<!-- <el-form
|
||||
<!-- <el-form
|
||||
:model="dialogQuery"
|
||||
ref="dialogQuery"
|
||||
size="small"
|
||||
|
|
@ -482,7 +460,12 @@
|
|||
align="center"
|
||||
width="80"
|
||||
type="index"
|
||||
:index="indexContinuation(dialogQuery.pageNum, dialogQuery.pageSize)"
|
||||
:index="
|
||||
indexContinuation(
|
||||
dialogQuery.pageNum,
|
||||
dialogQuery.pageSize,
|
||||
)
|
||||
"
|
||||
>
|
||||
<!-- <template slot-scope="scope">
|
||||
<span>{{
|
||||
|
|
@ -521,10 +504,10 @@
|
|||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="出库时间"
|
||||
align="center"
|
||||
prop="outTime"
|
||||
:show-overflow-tooltip="true"
|
||||
label="出库时间"
|
||||
align="center"
|
||||
prop="outTime"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
</el-table>
|
||||
|
||||
|
|
@ -613,7 +596,7 @@ export default {
|
|||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
}
|
||||
},
|
||||
],
|
||||
teamName: [
|
||||
{
|
||||
|
|
@ -641,7 +624,7 @@ export default {
|
|||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
}
|
||||
},
|
||||
],
|
||||
teamName: [
|
||||
{
|
||||
|
|
@ -675,9 +658,9 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
// 按钮状态改变
|
||||
toggleBtn (count) {
|
||||
this.leaseType = count;
|
||||
this.getList(this.leaseType);
|
||||
toggleBtn(count) {
|
||||
this.leaseType = count
|
||||
this.getList(this.leaseType)
|
||||
},
|
||||
//获取单位
|
||||
getUnitList() {
|
||||
|
|
@ -728,7 +711,7 @@ export default {
|
|||
/** 查询列表 */
|
||||
getList(leaseType) {
|
||||
this.loading = true
|
||||
this.queryParams.leaseType = leaseType;
|
||||
this.queryParams.leaseType = leaseType
|
||||
secondaryWarehouseList(this.queryParams).then((response) => {
|
||||
this.deviceList = response.rows
|
||||
this.total = response.total
|
||||
|
|
@ -750,7 +733,7 @@ export default {
|
|||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
// this.queryParams.pageNum = 1
|
||||
this.getList(this.leaseType)
|
||||
},
|
||||
handleDialogQuery() {
|
||||
|
|
@ -815,7 +798,8 @@ export default {
|
|||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (
|
||||
parseInt(this.form.outNum) > parseInt(this.form.zkNum)
|
||||
parseInt(this.form.outNum) >
|
||||
parseInt(this.form.zkNum)
|
||||
) {
|
||||
this.$message.error('出库数量不可大于在库数量')
|
||||
return
|
||||
|
|
@ -892,29 +876,29 @@ export default {
|
|||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.upper-sec{
|
||||
display: flex;
|
||||
margin-bottom: 15px;
|
||||
div{
|
||||
box-sizing: border-box;
|
||||
padding: 10px 30px;
|
||||
background-color: #fff;
|
||||
color: #999999;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
div:first-child{
|
||||
border-bottom-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
div:last-child{
|
||||
border-top-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
.clicked{
|
||||
background-color: #409EFF;
|
||||
color: #fff;
|
||||
}
|
||||
.upper-sec {
|
||||
display: flex;
|
||||
margin-bottom: 15px;
|
||||
div {
|
||||
box-sizing: border-box;
|
||||
padding: 10px 30px;
|
||||
background-color: #fff;
|
||||
color: #999999;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
div:first-child {
|
||||
border-bottom-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
div:last-child {
|
||||
border-top-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
.clicked {
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.clickText {
|
||||
color: #02a7f0;
|
||||
|
|
|
|||
Reference in New Issue