容器管理功能调整
This commit is contained in:
@@ -46,7 +46,7 @@ export function delContainer(containerId) {
|
||||
// 获取点位名称
|
||||
export function getPortNames() {
|
||||
return request({
|
||||
url: '/product/port/list',
|
||||
url: '/bas/container/portNames',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
<el-form-item label="点位名称" prop="portName">
|
||||
<el-select v-model="queryParams.portName" placeholder="请选择点位名称" clearable>
|
||||
<el-option
|
||||
v-for="dict in portNameOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
v-for="(item, index) in portNameOptions"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -50,7 +50,7 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['bas:container:add']"
|
||||
>新增</el-button>
|
||||
>新增/绑定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@@ -72,9 +72,9 @@
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['bas:container:remove']"
|
||||
>删除</el-button>
|
||||
>删除/解绑</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
@@ -83,7 +83,7 @@
|
||||
@click="handleExport"
|
||||
v-hasPermi="['bas:container:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@@ -132,19 +132,28 @@
|
||||
<el-input v-model="form.containerId" placeholder="请输入容器编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位名称" prop="portName">
|
||||
<el-select v-model="queryParams.portName" placeholder="请选择点位名称" clearable>
|
||||
<el-option
|
||||
disabled
|
||||
v-for="item in portNameOptions"
|
||||
:key="item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="item.dictValue"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料种类" prop="productTypeQuantity">
|
||||
<el-input v-model="form.productTypeQuantity" placeholder="请输入物料种类" />
|
||||
<el-select v-model="form.portName" placeholder="请选择点位名称" clearable>
|
||||
<el-option
|
||||
v-for="(item, index) in portNameOptions"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="portName">
|
||||
<el-select v-model="form.status" placeholder="请选择货架状态" clearable>
|
||||
<el-option
|
||||
v-for="status in dict.type.stock_status.slice(0, 2)"
|
||||
:key="status.value"
|
||||
:label="status.label"
|
||||
:value="status.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="物料种类" prop="productTypeQuantity">
|
||||
<el-input v-model="form.productTypeQuantity" placeholder="请输入物料种类" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="操作人" prop="operationMan">
|
||||
<el-input v-model="form.operationMan" placeholder="请输入操作人" />
|
||||
</el-form-item>
|
||||
@@ -158,10 +167,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listContainer, getContainer, delContainer, addContainer, updateContainer } from "@/api/bas/container"
|
||||
import { listContainer, getContainer, delContainer, addContainer, updateContainer, getPortNames } from "@/api/bas/container"
|
||||
import { get } from "sortablejs"
|
||||
|
||||
export default {
|
||||
name: "Container",
|
||||
dicts: ['stock_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@@ -194,6 +205,7 @@ export default {
|
||||
operationMan: null,
|
||||
},
|
||||
portNameOptions: [],
|
||||
statusOptions: ['空', '有货'],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
@@ -203,6 +215,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
// this.getPortNames()
|
||||
},
|
||||
methods: {
|
||||
/** 查询容器管理列表 */
|
||||
@@ -210,13 +223,27 @@ export default {
|
||||
this.loading = true
|
||||
listContainer(this.queryParams).then(response => {
|
||||
this.containerList = response.rows
|
||||
this.portNameOptions = response.portNameOptions
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
console.log(response)
|
||||
console.log(this.portNameOptions)
|
||||
|
||||
//@@@
|
||||
getPortNames().then(res => {
|
||||
if (res.code === 200) {
|
||||
// this.portNameOptions = res.data || [];
|
||||
this.portNameOptions = Array.isArray(res.data) ? [...res.data] : [];
|
||||
// console.log(this.portNameOptions);
|
||||
} else {
|
||||
this.$message.error('获取点位名称失败');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message.error('请求异常,请检查网络');
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
@@ -275,15 +302,19 @@ export default {
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.containerId != null) {
|
||||
if (this.title === "修改容器管理") {
|
||||
updateContainer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
//@@@
|
||||
this.form.productTypeQuantity = 'Type-01';
|
||||
this.form.capacity = 10;
|
||||
addContainer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
// console.log(this.form.containerId + this.form.portName +this.form.operationMan);
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user