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