格式化代码

This commit is contained in:
刘名喜 2024-12-16 15:01:51 +08:00
parent ae39ff817a
commit 0c8aca192b

View File

@ -78,7 +78,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mes:wm:area:add']" v-hasPermi="['mes:wm:area:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -89,7 +90,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['mes:wm:area:edit']" v-hasPermi="['mes:wm:area:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -100,28 +102,30 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['mes:wm:area:remove']" v-hasPermi="['mes:wm:area:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="areaList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="areaList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="库位编码" align="center" prop="areaCode" > <el-table-column label="库位编码" align="center" prop="areaCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@click="handleView(scope.row)" @click="handleView(scope.row)"
v-hasPermi="['mes:wm:area:query']" v-hasPermi="['mes:wm:area:query']"
>{{scope.row.areaCode}}</el-button> >{{ scope.row.areaCode }}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="库位名称" align="center" prop="areaName" /> <el-table-column label="库位名称" align="center" prop="areaName"/>
<el-table-column label="所属库区" align="center" prop="locationName" /> <el-table-column label="所属库区" align="center" prop="locationName"/>
<el-table-column label="上级库位" align="center" prop="superiorName" /> <el-table-column label="上级库位" align="center" prop="superiorName"/>
<el-table-column label="X" align="center" prop="positionX" /> <el-table-column label="X" align="center" prop="positionX"/>
<el-table-column label="y" align="center" prop="positionY" /> <el-table-column label="y" align="center" prop="positionY"/>
<el-table-column label="z" align="center" prop="positionZ" /> <el-table-column label="z" align="center" prop="positionZ"/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -131,14 +135,16 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:wm:area:edit']" v-hasPermi="['mes:wm:area:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['mes:wm:area:remove']" v-hasPermi="['mes:wm:area:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -163,7 +169,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label-width="80"> <el-form-item label-width="80">
<el-switch v-model="autoGenFlag" <el-switch v-model="autoGenFlag"
active-color="#13ce66" active-color="#13ce66"
active-text="自动生成" active-text="自动生成"
@ -175,14 +181,14 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="库位名称" prop="areaName"> <el-form-item label="库位名称" prop="areaName">
<el-input v-model="form.areaName" placeholder="请输入库位名称" /> <el-input v-model="form.areaName" placeholder="请输入库位名称"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<div style="display: flex"> <div style="display: flex">
<el-form-item label="库区" prop="locationId"> <el-form-item label="库区" prop="locationId">
<div style="display: flex"> <div style="display: flex">
<el-input v-model="form.locationName" placeholder="请选择库区名称" /> <el-input v-model="form.locationName" placeholder="请选择库区名称"/>
<el-button @click="selecocationVisible=true" icon="el-icon-search"></el-button> <el-button @click="selecocationVisible=true" icon="el-icon-search"></el-button>
</div> </div>
</el-form-item> </el-form-item>
@ -206,24 +212,24 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="库位位置X" prop="positionX"> <el-form-item label="库位位置X" prop="positionX">
<el-input-number :min="0" :step="1" v-model="form.positionX" placeholder="请输入库位位置X" /> <el-input-number :min="0" :step="1" v-model="form.positionX" placeholder="请输入库位位置X"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="库位位置y" prop="positionY"> <el-form-item label="库位位置y" prop="positionY">
<el-input-number :min="0" :step="1" v-model="form.positionY" placeholder="请输入库位位置y" /> <el-input-number :min="0" :step="1" v-model="form.positionY" placeholder="请输入库位位置y"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="库位位置z" prop="positionZ"> <el-form-item label="库位位置z" prop="positionZ">
<el-input-number :min="0" :step="1" v-model="form.positionZ" placeholder="请输入库位位置z" /> <el-input-number :min="0" :step="1" v-model="form.positionZ" placeholder="请输入库位位置z"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -255,15 +261,15 @@ import SelecAreaCmps from "@/components/wm/SelecAreaCmps.vue";
export default { export default {
name: "Area", name: "Area",
dicts: ['sys_yes_no'], dicts: ['sys_yes_no'],
components: {SelecLocationCmps, BarcodeImg,SelecAreaCmps } , components: {SelecLocationCmps, BarcodeImg, SelecAreaCmps},
data() { data() {
return { return {
// //
selecareaVisible:false, selecareaVisible: false,
// //
selecocationVisible:false, selecocationVisible: false,
// //
autoGenFlag:false, autoGenFlag: false,
optType: undefined, optType: undefined,
locationId: undefined, locationId: undefined,
// //
@ -302,16 +308,16 @@ export default {
// //
rules: { rules: {
areaCode: [ areaCode: [
{ required: true, message: "库位编码不能为空", trigger: "blur" } {required: true, message: "库位编码不能为空", trigger: "blur"}
], ],
areaName: [ areaName: [
{ required: true, message: "库位名称不能为空", trigger: "blur" } {required: true, message: "库位名称不能为空", trigger: "blur"}
], ],
locationId: [ locationId: [
{ required: true, message: "库区不能为空", trigger: "blur" } {required: true, message: "库区不能为空", trigger: "blur"}
], ],
attr1: [ attr1: [
{ required: true, message: "上级库位名称不能为空", trigger: "blur" } {required: true, message: "上级库位名称不能为空", trigger: "blur"}
] ]
} }
}; };
@ -389,7 +395,7 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.areaId) this.ids = selection.map(item => item.areaId)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
@ -400,7 +406,7 @@ export default {
this.optType = "add"; this.optType = "add";
}, },
// //
handleView(row){ handleView(row) {
this.reset(); this.reset();
const areaId = row.areaId || this.ids const areaId = row.areaId || this.ids
getArea(areaId).then(response => { getArea(areaId).then(response => {
@ -445,25 +451,26 @@ export default {
* 冻结状态变更 * 冻结状态变更
* @param row * @param row
*/ */
handleFrozenChange(row){ handleFrozenChange(row) {
let text = row.frozenFlag === "Y" ? "冻结" : "解冻"; let text = row.frozenFlag === "Y" ? "冻结" : "解冻";
this.$modal.confirm('确认要"' + text + '""' + row.areaName + '"库位吗?').then(function() { this.$modal.confirm('确认要"' + text + '""' + row.areaName + '"库位吗?').then(function () {
return changeFrozenState(row.areaId,row.frozenFlag); return changeFrozenState(row.areaId, row.frozenFlag);
}).then(() => { }).then(() => {
this.$modal.msgSuccess(text + "成功"); this.$modal.msgSuccess(text + "成功");
}).catch(function() { }).catch(function () {
row.frozenFlag = row.frozenFlag === "N" ? "Y" : "N"; row.frozenFlag = row.frozenFlag === "N" ? "Y" : "N";
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const areaIds = row.areaId || this.ids; const areaIds = row.areaId || this.ids;
this.$modal.confirm('是否确认删除库位设置编号为"' + areaIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除库位设置编号为"' + areaIds + '"的数据项?').then(function () {
return delArea(areaIds); return delArea(areaIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -472,12 +479,12 @@ export default {
}, `area_${new Date().getTime()}.xlsx`) }, `area_${new Date().getTime()}.xlsx`)
}, },
// //
handleAutoGenChange(autoGenFlag){ handleAutoGenChange(autoGenFlag) {
if(autoGenFlag){ if (autoGenFlag) {
genCode('AREA_CODE').then(response =>{ genCode('AREA_CODE').then(response => {
this.form.areaCode = response; this.form.areaCode = response;
}); });
}else{ } else {
this.form.areaCode = null; this.form.areaCode = null;
} }
} }