提交添加货位管理中删料是的确认界面

master
Comair 2 years ago
parent 5e25fe4ef1
commit 26d0cf5280
  1. 8
      src/api/wcs/location.js
  2. 30
      src/views/wcs/configuration/index.vue
  3. 91
      src/views/wcs/location/index.vue

@ -16,6 +16,14 @@ export function getLocation(id) {
method: 'get'
})
}
// 查询货位信息详细lo
export function handleDelOrAddBox(params) {
return request({
url: '/wcs/location/handleDelOrAddBox',
params: params,
method: 'post'
})
}
// 新增货位信息
export function addLocation(data) {

@ -131,19 +131,19 @@ export default {
}
},
},
{
label: "通信状态",
prop: "communicationStatus",
istrue: true,
filter(row, value) {
if(row.communicationStatus === "0"){
return "未连接";
}else if(row.communicationStatus === "1"){
return "已连接";
}
},
},
// {
// label: "",
// prop: "communicationStatus",
// istrue: true,
// filter(row, value) {
// if(row.communicationStatus === "0"){
// return "";
// }else if(row.communicationStatus === "1"){
// return "";
// }
// },
//
// },
{
label: "创建时间",
prop: "createTime",
@ -176,7 +176,7 @@ export default {
name: "切离",
event: "handleCutOff",
hidden(value) {
if (value.equipmentStatus === '2') {
if (value.equipmentStatus === '2' && value.equipmentName != 'WCS') {
return false;
} else {
return true;
@ -186,7 +186,7 @@ export default {
name: "恢复",
event: "handleCutIn",
hidden(value) {
if (value.equipmentStatus === '1') {
if (value.equipmentStatus === '1' && value.equipmentName != 'WCS') {
return false;
} else {
return true;

@ -166,13 +166,21 @@
v-hasPermi="['wcs:location:edit']"
>修改
</el-button>
<el-button
<el-button v-if="scope.row.boxId !== '' && scope.row.boxId !== null"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
@click="handleDelBox(scope.row)"
v-hasPermi="['wcs:location:remove']"
>删除
>删料
</el-button>
<el-button v-if="!(scope.row.boxId !== '' && scope.row.boxId !== null)"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleAddBox(scope.row)"
v-hasPermi="['wcs:location:remove']"
>建料
</el-button>
<el-button
size="mini"
@ -237,7 +245,7 @@
v-for="dict in dict.type.location_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
:value="Number(dict.value)"
/>
</el-select>
</el-form-item>
@ -253,7 +261,7 @@
v-for="dict in dict.type.location_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
:value="Number(dict.value)"
/>
</el-select>
</el-form-item>
@ -271,27 +279,36 @@
<el-form-item label="列" prop="locationColumn">
<el-input v-model="form.locationColumn" placeholder="请输入列"/>
</el-form-item>
<el-form-item label="锁定标识" prop="lockFlag">
<el-select
v-model="form.lockFlag"
placeholder="锁定标识"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.lock_flag_dict"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="锁定标识" prop="lockFlag">-->
<!-- <el-select-->
<!-- v-model="form.lockFlag"-->
<!-- placeholder="锁定标识"-->
<!-- clearable-->
<!-- style="width: 240px"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.lock_flag_dict"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</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-dialog title="建账" :visible.sync="addBoxType" width="500px" append-to-body>
<el-input v-model="addBoxId" placeholder="请输入boxID"/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitAddBox"> </el-button>
<el-button @click="cancelAddBox"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -299,6 +316,7 @@
import {
listLocation,
getLocation,
handleDelOrAddBox,
delLocation,
verifyLocation,
addLocation,
@ -330,6 +348,7 @@ export default {
title: '',
//
open: false,
addBoxType: false,
//
queryParams: {
pageNum: 1,
@ -340,6 +359,8 @@ export default {
locationType: null,
locationStatus: null
},
addBoxId: null,
locationCode: '',
//
form: {},
//
@ -380,6 +401,10 @@ export default {
this.open = false
this.reset()
},
cancelAddBox() {
this.addBoxType = false
this.addBoxId = null;
},
//
reset() {
this.form = {
@ -431,6 +456,32 @@ export default {
this.title = '修改货位信息'
})
},
/** 删料或者按钮操作 */
handleDelBox(row) {
this.$modal.confirm('是否确认删除boxID" ' + row.boxId + ' "吗?').then(function() {
return handleDelOrAddBox({locationCode: "",boxId: row.boxId});
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {})
},
//
handleAddBox(row) {
this.locationCode = row.locationCode;
this.addBoxType = true;
},
submitAddBox() {
if(this.addBoxId.trim() === null || this.addBoxId.trim() === ""){
this.$modal.msgError('boxID不能为空');
}
handleDelOrAddBox({locationCode: this.locationCode,boxId: this.addBoxId}).then(response => {
this.locationCode = null;
this.addBoxId = null;
this.addBoxType = false;
this.getList();
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {

Loading…
Cancel
Save