国学标签
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div
|
||||
class="commonShopproduct"
|
||||
:style="`width: 100%; height: 100%; margin-top: -50px`"
|
||||
:style="`width: 100%; height: 100%; margin-top: ${!isNoSearch?'-50px':'0'}`"
|
||||
>
|
||||
<!-- <el-form
|
||||
:inline="true"
|
||||
@@ -286,7 +286,7 @@ export default {
|
||||
// }
|
||||
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl(this.urlList.getAssociatedGoodsList),
|
||||
url: this.$http.adornUrl(this.urlList.hasBindProductList),
|
||||
method: "post",
|
||||
params: this.$http.adornParams({
|
||||
...this.defaultForm,
|
||||
@@ -322,10 +322,10 @@ export default {
|
||||
|
||||
this.dataListLoading = true;
|
||||
|
||||
if (this.axiosType == "raw") {
|
||||
if (this.otherInfo.httpType == "raw") {
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.getAssociatedGoodsList}`),
|
||||
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
|
||||
method: "POST",
|
||||
data: {
|
||||
...form
|
||||
@@ -336,7 +336,6 @@ export default {
|
||||
}
|
||||
})
|
||||
.then(async ({ data }) => {
|
||||
console.log('data at line 338:', data)
|
||||
if (data && data.code === 0) {
|
||||
this.associatedGoodsList = [...data[this.otherInfo.httpDataValueName]];
|
||||
|
||||
@@ -345,28 +344,6 @@ export default {
|
||||
});
|
||||
}
|
||||
|
||||
else if (this.defaultForm.httpType == "raw") {
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
|
||||
method: "POST",
|
||||
data: {
|
||||
productId: this.defaultForm.productId
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
.then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.associatedGoodsList = [...data[this.defaultForm.httpDataValueName]];
|
||||
|
||||
this.dataListLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl(`${this.urlList.getAssociatedGoodsList}`),
|
||||
|
||||
@@ -246,7 +246,7 @@ export default {
|
||||
// }
|
||||
this.dataListLoading = true;
|
||||
this.clear();
|
||||
if (this.defaultForm.httpType == "raw"||this.otherInfo.httpType == "raw") {
|
||||
if (this.otherInfo.httpType == "raw") {
|
||||
form.page = this.pageIndex;
|
||||
this.$http
|
||||
.request({
|
||||
@@ -261,9 +261,10 @@ export default {
|
||||
}
|
||||
})
|
||||
.then(({ data }) => {
|
||||
console.log('data at line 263:', data)
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = [...data.page[this.defaultForm.httpDataValueName]];
|
||||
this.totalPage = data.page[this.defaultForm.httpDataTotalName];
|
||||
this.dataList = [...data.page[this.otherInfo.httpDataValueName]];
|
||||
this.totalPage = data.page[this.otherInfo.httpDataTotalName];
|
||||
} else {
|
||||
this.dataList = [];
|
||||
this.totalPage = 0;
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
<!-- :allow-drop="allowDrop" -->
|
||||
<div class="custom-tree-container">
|
||||
<el-tree
|
||||
:draggable="false"
|
||||
:allow-drop="false"
|
||||
:highlight-current="true"
|
||||
class="filter-tree"
|
||||
node-key="id"
|
||||
@@ -43,7 +45,6 @@
|
||||
default-expand-all
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
:draggable="true"
|
||||
@node-click="handleNodeClick"
|
||||
:expand-on-click-node="false"
|
||||
>
|
||||
@@ -326,11 +327,10 @@ export default {
|
||||
...this.addForm
|
||||
})
|
||||
}).then(async ({ data }) => {
|
||||
console.log('data at line 328:', data)
|
||||
console.log("data at line 328:", data);
|
||||
if (data && data.code === 0) {
|
||||
if (this.axiosResultKey) {
|
||||
|
||||
console.log('at line 331:',data[this.axiosResultKey] )
|
||||
console.log("at line 331:", data[this.axiosResultKey]);
|
||||
}
|
||||
var status = await this.correlationShop(
|
||||
data[this.axiosResultKey ? this.axiosResultKey : "result"].id
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
</div>
|
||||
<!-- :isNoSearch="true" -->
|
||||
<commonShop
|
||||
:isNoSearch="true"
|
||||
:otherInfo="{
|
||||
httpType: 'raw',
|
||||
httpDataValueName: 'courseList'
|
||||
}"
|
||||
:defaultForm="{
|
||||
@@ -314,11 +316,12 @@ export default {
|
||||
urlList: {
|
||||
treeList: "/master/courseSociologyMarket/marketTree",
|
||||
delete: "/master/courseSociologyMarket/delMarket",
|
||||
deleteShop: "/master/courseSociologyMarket/delToMarket",
|
||||
saveShop: "/master/courseSociologyMarket/saveToMarket",
|
||||
deleteShop:
|
||||
"/master/courseSociologyMarket/unbindCourseAndSociologyMarket",
|
||||
saveShop: "/master/courseSociologyMarket/bindCourseAndSociologyMarket",
|
||||
add: "/master/courseSociologyMarket/addSociologyMarket",
|
||||
edit: "/master/courseSociologyMarket/editSociologyMarket",
|
||||
getAssociatedGoodsList:
|
||||
hasBindProductList:
|
||||
"/master/courseSociologyMarket/getCourseListByMarketId",
|
||||
CanBindProductList: "/master/courseSociologyMarket/getNotToMarketList"
|
||||
},
|
||||
@@ -426,14 +429,20 @@ export default {
|
||||
});
|
||||
},
|
||||
handleSubmitShopTable: debounce(async function(ids) {
|
||||
await this.$http({
|
||||
await this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
method: "POST",
|
||||
data: {
|
||||
courseId: ids,
|
||||
marketId: this.addForm.id
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
}).then(async ({ data }) => {
|
||||
.then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
|
||||
@@ -538,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)
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -568,15 +583,20 @@ 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 }) => {
|
||||
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 {
|
||||
|
||||
@@ -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
|
||||
:isNoSearch="true"
|
||||
:otherInfo="{
|
||||
httpType: 'raw',
|
||||
httpDataValueName: 'courseList'
|
||||
}"
|
||||
:defaultForm="{
|
||||
title: '',
|
||||
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,14 +429,20 @@ export default {
|
||||
});
|
||||
},
|
||||
handleSubmitShopTable: debounce(async function(ids) {
|
||||
await this.$http({
|
||||
await this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
method: "POST",
|
||||
data: {
|
||||
courseId: ids,
|
||||
marketId: this.addForm.id
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
}).then(async ({ data }) => {
|
||||
.then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
|
||||
@@ -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,15 +583,20 @@ 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 }) => {
|
||||
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 {
|
||||
|
||||
@@ -20,11 +20,14 @@
|
||||
</div>
|
||||
<commonShop
|
||||
:isNoSearch="true"
|
||||
:otherInfo="{
|
||||
httpType: 'raw',
|
||||
httpDataValueName: this.source == 'book' ? 'books' : 'course'
|
||||
}"
|
||||
:defaultForm="{
|
||||
title: '',
|
||||
productId: this.productId,
|
||||
httpType: 'raw',
|
||||
httpDataValueName: this.source == 'book' ? 'books' : 'course'
|
||||
|
||||
// marketId: addForm.id
|
||||
}"
|
||||
getAssociatedGoodsListKey="marketId"
|
||||
@@ -257,13 +260,16 @@
|
||||
</el-form> -->
|
||||
<commonShopTable
|
||||
:title="title"
|
||||
:defaultForm="{
|
||||
keywords: '',
|
||||
id: productId,
|
||||
:otherInfo="{
|
||||
httpType:'raw',
|
||||
httpDataValueName: this.source == 'book' ? 'records' : 'data',
|
||||
httpDataTotalName: this.source == 'book' ? 'total' : 'count'
|
||||
}"
|
||||
:defaultForm="{
|
||||
keywords: '',
|
||||
id: productId,
|
||||
|
||||
}"
|
||||
:urlList="urlList"
|
||||
:tableColumnList="tableColumnList"
|
||||
marketIdKey="marketId"
|
||||
|
||||
Reference in New Issue
Block a user