代码优化

This commit is contained in:
BianLzhaoMin 2024-08-19 17:08:14 +08:00
parent f40a8a5119
commit 9bfcacb4df
1 changed files with 89 additions and 105 deletions

View File

@ -1,19 +1,10 @@
<template> <template>
<div class="app-container" id="secondStore"> <div class="app-container" id="secondStore">
<div <div class="upper-sec">
class="upper-sec" <div :class="[{ clicked: leaseType == 1 }]" @click="toggleBtn(1)">
>
<div
:class="[{ clicked: leaseType == 1 }]"
@click="toggleBtn(1)"
>
长期领用 长期领用
</div> </div>
<div <div :class="[{ clicked: leaseType == 0 }]" @click="toggleBtn(0)">
:class="[{ clicked: leaseType == 0 }]"
@click="toggleBtn(0)"
>
工程领用 工程领用
</div> </div>
</div> </div>
@ -166,7 +157,6 @@
label="工程名称" label="工程名称"
align="center" align="center"
key="3" key="3"
prop="proName" prop="proName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
v-if="leaseType == 0" v-if="leaseType == 0"
@ -175,7 +165,6 @@
label="类型名称" label="类型名称"
align="center" align="center"
key="4" key="4"
prop="typeName" prop="typeName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
@ -183,7 +172,6 @@
label="规格型号" label="规格型号"
align="center" align="center"
key="5" key="5"
prop="modelName" prop="modelName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
@ -191,7 +179,6 @@
label="计量单位" label="计量单位"
align="center" align="center"
key="6" key="6"
prop="nuitName" prop="nuitName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
@ -199,7 +186,6 @@
label="总量" label="总量"
align="center" align="center"
key="7" key="7"
prop="num" prop="num"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
v-if="leaseType == 1" v-if="leaseType == 1"
@ -208,7 +194,6 @@
label="库存数量" label="库存数量"
align="center" align="center"
key="8" key="8"
prop="stockNum" prop="stockNum"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
v-if="leaseType == 1" v-if="leaseType == 1"
@ -217,7 +202,6 @@
label="领用数量" label="领用数量"
align="center" align="center"
key="9" key="9"
prop="receiveNum" prop="receiveNum"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
v-if="leaseType == 1" v-if="leaseType == 1"
@ -234,7 +218,6 @@
label="在用数量" label="在用数量"
align="center" align="center"
key="10" key="10"
prop="receiveNum" prop="receiveNum"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
v-if="leaseType == 0" v-if="leaseType == 0"
@ -243,7 +226,6 @@
label="操作" label="操作"
align="center" align="center"
key="11" key="11"
width="150" width="150"
v-if="leaseType == 1" v-if="leaseType == 1"
> >
@ -273,11 +255,10 @@
</el-table> </el-table>
<pagination <pagination
v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList(leaseType)"
/> />
<!-- 出库弹窗 --> <!-- 出库弹窗 -->
@ -383,10 +364,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="领用数量" prop="ckNum"> <el-form-item label="领用数量" prop="ckNum">
<el-input <el-input v-model="nform.ckNum" disabled />
v-model="nform.ckNum"
disabled
/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="已出库数量" prop="ckNum"> <!-- <el-form-item label="已出库数量" prop="ckNum">
<el-input v-model="nform.ckNum" disabled /> <el-input v-model="nform.ckNum" disabled />
@ -482,7 +460,12 @@
align="center" align="center"
width="80" width="80"
type="index" type="index"
:index="indexContinuation(dialogQuery.pageNum, dialogQuery.pageSize)" :index="
indexContinuation(
dialogQuery.pageNum,
dialogQuery.pageSize,
)
"
> >
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<span>{{ <span>{{
@ -613,7 +596,7 @@ export default {
} }
}, },
trigger: 'blur', trigger: 'blur',
} },
], ],
teamName: [ teamName: [
{ {
@ -641,7 +624,7 @@ export default {
} }
}, },
trigger: 'blur', trigger: 'blur',
} },
], ],
teamName: [ teamName: [
{ {
@ -676,8 +659,8 @@ export default {
methods: { methods: {
// //
toggleBtn(count) { toggleBtn(count) {
this.leaseType = count; this.leaseType = count
this.getList(this.leaseType); this.getList(this.leaseType)
}, },
// //
getUnitList() { getUnitList() {
@ -728,7 +711,7 @@ export default {
/** 查询列表 */ /** 查询列表 */
getList(leaseType) { getList(leaseType) {
this.loading = true this.loading = true
this.queryParams.leaseType = leaseType; this.queryParams.leaseType = leaseType
secondaryWarehouseList(this.queryParams).then((response) => { secondaryWarehouseList(this.queryParams).then((response) => {
this.deviceList = response.rows this.deviceList = response.rows
this.total = response.total this.total = response.total
@ -750,7 +733,7 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 // this.queryParams.pageNum = 1
this.getList(this.leaseType) this.getList(this.leaseType)
}, },
handleDialogQuery() { handleDialogQuery() {
@ -815,7 +798,8 @@ export default {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
if ( if (
parseInt(this.form.outNum) > parseInt(this.form.zkNum) parseInt(this.form.outNum) >
parseInt(this.form.zkNum)
) { ) {
this.$message.error('出库数量不可大于在库数量') this.$message.error('出库数量不可大于在库数量')
return return
@ -912,7 +896,7 @@ export default {
border-bottom-right-radius: 3px; border-bottom-right-radius: 3px;
} }
.clicked { .clicked {
background-color: #409EFF; background-color: #409eff;
color: #fff; color: #fff;
} }
} }