|
@@ -56,7 +56,7 @@
|
|
|
<el-form class="list-search-container" :model="carrierParams" ref="queryRef" :inline="true">
|
|
|
<el-form-item class="section-title" label="载具管理" />
|
|
|
<el-form-item label="载具编号:">
|
|
|
- <el-input placeholder="请输入载具编号" clearable style="width: 180px" v-model.trim="carrierParams.code" @keydown.enter.prevent @keyup.enter="handleQueryCarrier" />
|
|
|
+ <el-input placeholder="请输入载具编号" :disabled="carrierCategoryList.length == 0" clearable style="width: 180px" v-model.trim="carrierParams.code" @keydown.enter.prevent @keyup.enter="handleQueryCarrier" />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="info" icon="Search" :disabled="carrierCategoryList.length == 0" @click="handleQueryCarrier">搜索</el-button>
|
|
@@ -221,22 +221,34 @@ function handleShowCategoryDialog(data) {
|
|
|
const handleDeleteCategory = (data) => {
|
|
|
// 禁用按钮点击
|
|
|
disableButtons();
|
|
|
+ var showErrorMessage = false
|
|
|
proxy.$modal
|
|
|
.confirm('确定删除选中项?')
|
|
|
.then(() => {
|
|
|
categoryLoading.value = true
|
|
|
carrierLoading.value = true
|
|
|
+ if (data.children) {
|
|
|
+ showErrorMessage = true;
|
|
|
+ return Promise.reject(new Error("HasChildrenError"));
|
|
|
+ }
|
|
|
return delCategory(data.id)
|
|
|
})
|
|
|
.then(() => {
|
|
|
- proxy.$modal.msgSuccess('操作成功!')
|
|
|
- getCategories()
|
|
|
+ if (!showErrorMessage) {
|
|
|
+ proxy.$modal.msgSuccess('操作成功!');
|
|
|
+ getCategories();
|
|
|
+ }
|
|
|
})
|
|
|
.catch(() => {
|
|
|
categoryLoading.value = false
|
|
|
carrierLoading.value = false
|
|
|
})
|
|
|
.finally(() => {
|
|
|
+ if (showErrorMessage) {
|
|
|
+ proxy.$modal.msgError("该载具类别下有子类别,不能删除!");
|
|
|
+ }
|
|
|
+ categoryLoading.value = false
|
|
|
+ carrierLoading.value = false
|
|
|
// 启用按钮点击
|
|
|
enableButtons();
|
|
|
})
|