yujialong 10 months ago
parent f3b80e173c
commit 11902a5aa9
  1. 1
      src/api/index.js
  2. 8
      src/pages/activity/add/index.vue
  3. 68
      src/pages/miniProgramMg/index/banner/add/index.vue
  4. 83
      src/pages/miniProgramMg/index/hot/add/index.vue
  5. 10
      src/pages/user/list/index.vue

@ -50,6 +50,7 @@ export default {
updateAccountAllEnable: `users/users/userAccount/updateAccountAllEnable`,
updateTeamStatus: `nakadai/kindergarten/platformTeamAccount/updateTeamStatus`,
delUserAccounts: `users/users/userAccount/delUserAccounts`,
deletePrompt: `users/users/userAccount/deletePrompt`,
queryUserInfoByPhone: `nakadai/nakadai/partner-team/queryUserInfoByPhone`,
transferAdmin: `nakadai/nakadai/partnerAccount/transferAdmin`,
savePartnerAccount: `nakadai/nakadai/partnerAccount/savePartnerAccount`,

@ -201,9 +201,11 @@
</el-form>
<div class="btns">
<el-button @click="save(0)">保存</el-button>
<el-button type="primary"
@click="save(1)">发布</el-button>
<template v-if="editing || !id">
<el-button @click="save(0)">保存</el-button>
<el-button type="primary"
@click="save(1)">发布</el-button>
</template>
<el-button type="danger"
@click="preview">预览</el-button>
<el-button @click="back">取消</el-button>

@ -54,7 +54,34 @@
:value="item.id">
</el-option>
</el-select>
<el-select class="m-l-20"
<template v-if="form.selectLinkId === '1'">
<el-select class="m-l-20"
style="width: 150px"
placeholder="请选择供应商"
v-model="form.correspondingLinkId"
filterable
@change="getGoods">
<el-option v-for="item in linkDetails"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-select class="m-l-20"
style="width: 150px"
placeholder="请选择商品"
v-model="form.goodsId"
clearable
filterable>
<el-option v-for="item in goods"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
<el-select v-else
class="m-l-20"
v-model="form.correspondingLinkId"
clearable
filterable>
@ -95,6 +122,7 @@ export default {
originForm: {},
form: {
correspondingLinkId: '',
goodsId: '',
coverUrl: '',
details: '1',
description: '',
@ -122,6 +150,7 @@ export default {
name: '店铺'
},
],
goods: [],
linkDetails: [],
submiting: false,
updateTime: 0,
@ -160,7 +189,20 @@ export default {
}
})
}
// id
if (data.selectLinkId === '1' && data.correspondingLinkId.includes(',')) {
const linkId = data.correspondingLinkId.split(',')
data.correspondingLinkId = +linkId[0]
if (linkId.length > 1) {
data.goodsId = +linkId[1]
}
} else {
data.correspondingLinkId = +data.correspondingLinkId
}
if (!data.correspondingLinkId) data.correspondingLinkId = ''
if (!data.goodsId) data.goodsId = ''
this.form = data
data.goodsId && this.getGoods()
this.getDetails()
}).catch(err => { })
},
@ -169,7 +211,7 @@ export default {
if (id) this.form.correspondingLinkId = ''
const { selectLinkId } = this.form
//
if (selectLinkId === '2') {
if (selectLinkId === '2') { //
const { data } = await this.$post(this.api.postLoginActivity, {
pageNum: 1,
pageSize: 1000,
@ -180,7 +222,7 @@ export default {
e.id = +e.id
})
this.linkDetails = data.records
} else if (selectLinkId === '3') { //
} else if (selectLinkId === '1' || selectLinkId === '3') { //
const { data } = await this.$post(this.api.selectEnterpriseCertificationList, {
pageNum: 1,
pageSize: 1000,
@ -195,6 +237,22 @@ export default {
this.linkDetails = []
}
},
//
async getGoods (id) {
if (id) this.form.goodsId = ''
if (this.form.correspondingLinkId) {
const { page } = await this.$get(this.api.prodList, {
current: 1,
size: 1000,
shopId: this.form.correspondingLinkId
})
page.records.forEach(e => {
e.name = e.prodName
e.id = e.prodId
})
this.goods = page.records
}
},
//
clearDetails () {
this.form.correspondingLinkId = ''
@ -228,12 +286,14 @@ export default {
//
save (status) {
if (this.submiting) return false
const { form } = this
const form = JSON.parse(JSON.stringify(this.form))
if (!form.productName) return Util.warningMsg('请填写产品名称');
//
if (status) {
if (!form.coverUrl) return Util.warningMsg('请上传图片');
}
if (form.selectLinkId === '1' && form.correspondingLinkId && form.goodsId) form.correspondingLinkId = form.correspondingLinkId + ',' + form.goodsId
form.publishStatus = status
this.submiting = true
if (this.id) {

@ -53,6 +53,7 @@
<el-radio label="2">外链接</el-radio>
</el-radio-group>
</el-form-item>
{{ form.correspondingLinkId }}
<el-form-item v-if="form.link === '1'"
class="req"
label="链接内容">
@ -67,7 +68,34 @@
:value="item.id">
</el-option>
</el-select>
<el-select class="m-l-20"
<template v-if="form.selectLinkId === '1'">
<el-select class="m-l-20"
style="width: 150px"
placeholder="请选择供应商"
v-model="form.correspondingLinkId"
filterable
@change="getGoods">
<el-option v-for="item in linkDetails"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-select class="m-l-20"
style="width: 150px"
placeholder="请选择商品"
v-model="form.goodsId"
clearable
filterable>
<el-option v-for="item in goods"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
<el-select v-else
class="m-l-20"
v-model="form.correspondingLinkId"
clearable
filterable>
@ -112,6 +140,7 @@ export default {
originForm: {},
form: {
correspondingLinkId: '',
goodsId: '',
coverUrl: '',
details: '1',
description: '',
@ -139,6 +168,7 @@ export default {
name: '店铺'
},
],
goods: [],
linkDetails: [],
submiting: false,
updateTime: 0,
@ -179,7 +209,20 @@ export default {
}
})
}
// id
if (data.selectLinkId === '1' && data.correspondingLinkId.includes(',')) {
const linkId = data.correspondingLinkId.split(',')
data.correspondingLinkId = +linkId[0]
if (linkId.length > 1) {
data.goodsId = +linkId[1]
}
} else {
data.correspondingLinkId = +data.correspondingLinkId
}
if (!data.correspondingLinkId) data.correspondingLinkId = ''
if (!data.goodsId) data.goodsId = ''
this.form = data
data.goodsId && this.getGoods()
this.getDetails()
}).catch(err => { })
},
@ -187,18 +230,6 @@ export default {
async getDetails (id) {
if (id) this.form.correspondingLinkId = ''
const { selectLinkId } = this.form
// if (selectLinkId === '1') {
// const { data } = await this.$get(this.api.prodList, {
// current: 1,
// size: 1000,
// status: '',
// })
// data.records.forEach(e => {
// e.name = e.competitionName
// e.id = +e.id
// })
// this.linkDetails = data.records
// } else
if (selectLinkId === '2') { //
const { data } = await this.$post(this.api.postLoginActivity, {
pageNum: 1,
@ -206,11 +237,11 @@ export default {
listType: 0,
})
data.records.forEach(e => {
e.name = e.competitionName
e.id = +e.id
e.name = e.competitionName
})
this.linkDetails = data.records
} else if (selectLinkId === '3') { //
} else if (selectLinkId === '1' || selectLinkId === '3') { //
const { data } = await this.$post(this.api.selectEnterpriseCertificationList, {
pageNum: 1,
pageSize: 1000,
@ -218,13 +249,29 @@ export default {
})
data.records.forEach(e => {
e.name = e.companyName
e.id = +e.teamId
e.id = e.teamId
})
this.linkDetails = data.records
} else {
this.linkDetails = []
}
},
//
async getGoods (id) {
if (id) this.form.goodsId = ''
if (this.form.correspondingLinkId) {
const { page } = await this.$get(this.api.prodList, {
current: 1,
size: 1000,
shopId: this.form.correspondingLinkId
})
page.records.forEach(e => {
e.name = e.prodName
e.id = e.prodId
})
this.goods = page.records
}
},
//
clearDetails () {
this.form.correspondingLinkId = ''
@ -259,13 +306,15 @@ export default {
//
save (status) {
if (this.submiting) return false
const { form } = this
const form = JSON.parse(JSON.stringify(this.form))
if (!form.productName) return Util.warningMsg('请填写产品名称');
//
if (status) {
if (!this.pics.length) return Util.warningMsg('请上传封面图');
if (form.details === '1' && !form.description) return Util.warningMsg('请填写详情内容');
}
if (form.selectLinkId === '1' && form.correspondingLinkId && form.goodsId) form.correspondingLinkId = form.correspondingLinkId + ',' + form.goodsId
form.coverUrl = this.pics.map(e => e.url).join()
form.publishStatus = status
this.submiting = true

@ -288,8 +288,9 @@ export default {
toDetail (row, detail) {
this.$router.push(`detail?openId=${row.appOpenId}${detail ? '&show=1' : ''}`)
},
handleDelete (row) {
this.$confirm('确定要删除吗?', '提示', {
async handleDelete (row) {
const res = await this.$post(this.api.deletePrompt, [row.appOpenId])
this.$confirm(res.tips || '确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, [row.appOpenId]).then(async (res) => {
@ -308,10 +309,11 @@ export default {
handleSelectionChange (val) {
this.multipleSelection = val;
},
delAllSelection () {
async delAllSelection () {
if (this.multipleSelection.length) {
let delList = this.multipleSelection.map(e => e.appOpenId);
this.$confirm('确定要删除选中数据吗?', '提示', {
const res = await this.$post(this.api.deletePrompt, delList)
this.$confirm(res.tips || '确定要删除选中数据吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, delList).then(async (res) => {

Loading…
Cancel
Save