国学标签
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
<div class="mod-config">
|
||||
<commonTree
|
||||
source="tags"
|
||||
axiosType="raw"
|
||||
axiosResultKey="market"
|
||||
@changeCurrentNode="changeCurrentNode"
|
||||
ref="commonTree"
|
||||
:dataList="treeDataList"
|
||||
@@ -88,12 +90,19 @@
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- :isNoSearch="true" -->
|
||||
<commonShop
|
||||
:defaultForm="{
|
||||
title: '',
|
||||
marketId:addForm.id
|
||||
:isNoSearch="true"
|
||||
:otherInfo="{
|
||||
httpType: 'raw',
|
||||
httpDataValueName: 'courseList'
|
||||
}"
|
||||
:defaultForm="{
|
||||
marketId: addForm.id
|
||||
}"
|
||||
axiosType="raw"
|
||||
getAssociatedGoodsListKey="marketId"
|
||||
:isNoPaging="true"
|
||||
getAssociatedGoodsListValue="result"
|
||||
:tableColumnList="tableColumnList"
|
||||
:currentId="addForm.id ? addForm.id : ''"
|
||||
@@ -106,7 +115,12 @@
|
||||
:style="`height: calc(100% - 50px); `"
|
||||
>
|
||||
<template slot="searchFormItem" slot-scope="slotProps">
|
||||
<el-form-item label="课程名称" prop="title" class="form_item" style="width: 240px;">
|
||||
<!-- <el-form-item
|
||||
label="课程名称"
|
||||
prop="title"
|
||||
class="form_item"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="请输入课程名称"
|
||||
@@ -115,7 +129,7 @@
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="商品类型" prop="goodsType" class="form_item">
|
||||
<el-select
|
||||
size="small"
|
||||
@@ -209,9 +223,14 @@
|
||||
</el-form> -->
|
||||
<commonShopTable
|
||||
title="课程"
|
||||
:otherInfo="{
|
||||
httpType: 'raw',
|
||||
httpDataValueName: 'records',
|
||||
httpDataTotalName: 'total'
|
||||
}"
|
||||
:defaultForm="{
|
||||
title: '',
|
||||
marketId:addForm.id
|
||||
keywords: '',
|
||||
id: addForm.id
|
||||
}"
|
||||
:urlList="urlList"
|
||||
:tableColumnList="tableColumnList"
|
||||
@@ -222,12 +241,12 @@
|
||||
@submit="handleSubmitShopTable"
|
||||
>
|
||||
<template slot="searchFormItem" slot-scope="slotProps">
|
||||
<el-form-item label="课程名称" prop="title" class="form_item">
|
||||
<el-form-item label="课程名称" prop="keywords" class="form_item">
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="请输入课程名称"
|
||||
style="width: 100%"
|
||||
v-model="slotProps.dataForm.title"
|
||||
v-model="slotProps.dataForm.keywords"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
@@ -291,18 +310,20 @@ import commonTree from "@/views/components/commonBookTags/tags.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
isEdit: false,
|
||||
checkAll: false,
|
||||
isIndeterminate: true,
|
||||
urlList: {
|
||||
treeList: "/master/courseMedicineMarket/marketTree",
|
||||
delete: "/master/courseMarket/delMarket",
|
||||
deleteShop: "/master/courseMarket/delToMarket",
|
||||
saveShop: "/master/courseMarket/saveToMarket",
|
||||
add: "/master/courseSociologyMarket/saveOrUpdateMarket",
|
||||
getAssociatedGoodsList: "/master/courseMarket/getCourseByMarketId",
|
||||
getNotToLabelList: "/master/courseMarket/getNotToMarketList"
|
||||
treeList: "/master/courseSociologyMarket/marketTree",
|
||||
delete: "/master/courseSociologyMarket/delMarket",
|
||||
deleteShop:
|
||||
"/master/courseSociologyMarket/unbindCourseAndSociologyMarket",
|
||||
saveShop: "/master/courseSociologyMarket/bindCourseAndSociologyMarket",
|
||||
add: "/master/courseSociologyMarket/addSociologyMarket",
|
||||
edit: "/master/courseSociologyMarket/editSociologyMarket",
|
||||
hasBindProductList:
|
||||
"/master/courseSociologyMarket/getCourseListByMarketId",
|
||||
CanBindProductList: "/master/courseSociologyMarket/getNotToMarketList"
|
||||
},
|
||||
addForm: {},
|
||||
isFresh: false,
|
||||
@@ -408,32 +429,38 @@ export default {
|
||||
});
|
||||
},
|
||||
handleSubmitShopTable: debounce(async function(ids) {
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
courseId: ids,
|
||||
marketId: this.addForm.id
|
||||
await this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
|
||||
method: "POST",
|
||||
data: {
|
||||
courseId: ids,
|
||||
marketId: this.addForm.id
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
}).then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
.then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
|
||||
if (this.$refs.commonShop) {
|
||||
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
|
||||
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
|
||||
// id:this.addForm.id ? this.addForm.id : null
|
||||
// }
|
||||
if (this.$refs.commonShop) {
|
||||
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
|
||||
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
|
||||
// id:this.addForm.id ? this.addForm.id : null
|
||||
// }
|
||||
|
||||
this.$refs.commonShop.getAssociatedGoodsList();
|
||||
this.$refs.commonShop.getAssociatedGoodsList();
|
||||
}
|
||||
if (this.$refs.commonShopTable) {
|
||||
this.$refs.commonShopTable.close();
|
||||
}
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
if (this.$refs.commonShopTable) {
|
||||
this.$refs.commonShopTable.close();
|
||||
}
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}, 200),
|
||||
openTable() {
|
||||
this.isEdit = false;
|
||||
@@ -492,7 +519,9 @@ export default {
|
||||
await this.$refs[formName].validate(async valid => {
|
||||
if (valid) {
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl(`${this.urlList.add}`),
|
||||
url: this.$http.adornUrl(
|
||||
this.addForm.id ? this.urlList.edit : this.urlList.add
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
...this.addForm
|
||||
@@ -503,7 +532,7 @@ export default {
|
||||
await this.getDataList();
|
||||
|
||||
this.$nextTick(async () => {
|
||||
this.$refs.commonTree.setCurrentNodeShow(data.result.id);
|
||||
this.$refs.commonTree.setCurrentNodeShow(data.market.id);
|
||||
|
||||
this.addForm = data.result;
|
||||
this.currentNode = { data: { ...data.result } };
|
||||
@@ -518,6 +547,12 @@ export default {
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
setTimeout(()=>{
|
||||
this.addForm = { ...this.currentNode.data };
|
||||
},500)
|
||||
|
||||
// console.log('this.addForm at line 550:', this.addForm)
|
||||
// console.log('this.addForm at line 550:', this.currentNode)
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -548,31 +583,36 @@ export default {
|
||||
// return false;
|
||||
// }
|
||||
this.$refs.commonShop.dataListLoading = true;
|
||||
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
`${this.urlList.deleteShop}?marketId=${
|
||||
this.addForm.id
|
||||
}&courseId=${productIds}`
|
||||
),
|
||||
method: "post"
|
||||
}).then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success("删除成功");
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
// this.$refs.commonShop.selectShopArr = [];
|
||||
if (this.$refs.commonShop) {
|
||||
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
|
||||
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
|
||||
// id:this.addForm.id ? this.addForm.id : null
|
||||
// }
|
||||
this.$refs.commonShop.getAssociatedGoodsList();
|
||||
await this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.deleteShop}`),
|
||||
method: "POST",
|
||||
data: {
|
||||
courseId: productIds,
|
||||
marketId: this.addForm.id
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
.then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success("删除成功");
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
// this.$refs.commonShop.selectShopArr = [];
|
||||
if (this.$refs.commonShop) {
|
||||
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
|
||||
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
|
||||
// id:this.addForm.id ? this.addForm.id : null
|
||||
// }
|
||||
this.$refs.commonShop.getAssociatedGoodsList();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
}, 200),
|
||||
@@ -997,7 +1037,7 @@ export default {
|
||||
|
||||
.tree_content_box {
|
||||
height: calc(100% - 110px) !important;
|
||||
.shopFormBox{
|
||||
.shopFormBox {
|
||||
width: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user