仪器管理-设置小程序/企微可见标签

master
382696293@qq.com 2 years ago
parent 285039d7e5
commit 111993cf0f

@ -953,7 +953,7 @@ import {
listInstructions, listInstructions,
delInstructions, delInstructions,
addInstructions, addInstructions,
updateInstructions, listAllMode, updateInstructions, listAllMode, addInstrumentTag, listInstrumentTag,
} from '@/api/system/instrument' } from '@/api/system/instrument'
import {getToken} from '@/utils/auth' import {getToken} from '@/utils/auth'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
@ -1055,14 +1055,14 @@ export default {
}, },
/* 小程序可见标签 */ /* 小程序可见标签 */
miniProgramTag: { miniProgramTag: {
userId: null, instrumentId: null,
selectTagList: null, selectTagList: null,
visible: false, visible: false,
optionTree: [], optionTree: [],
}, },
/* 企微可见标签 */ /* 企微可见标签 */
wecomTag: { wecomTag: {
userId: null, instrumentId: null,
selectTagList: null, selectTagList: null,
visible: false, visible: false,
optionTree: [], optionTree: [],
@ -1684,6 +1684,9 @@ export default {
}, },
/* 设置小程序可见标签 */ /* 设置小程序可见标签 */
editMiniProgramTags(row) { editMiniProgramTags(row) {
/* 小程序可见标签 */
this.miniProgramTag.instrumentId = null;
this.miniProgramTag.selectTagList = null;
// //
getMiniProgramTagTree().then((Response) => { getMiniProgramTagTree().then((Response) => {
this.miniProgramTag.optionTree = Response.data this.miniProgramTag.optionTree = Response.data
@ -1693,11 +1696,21 @@ export default {
.split(',') .split(',')
.map(Number) .map(Number)
} }
this.miniProgramTag.userId = row.id this.miniProgramTag.instrumentId = row.id
listInstrumentTag({
instrumentId: row.id,
type: 1
}).then((res) => {
if (res.code == 200 && res.data != null && res.data.length > 0) {
this.miniProgramTag.selectTagList = res.data.map(obj => obj.tagId);
}
})
}) })
}, },
/* 设置企微可见标签 */ /* 设置企微可见标签 */
editWecomTags(row) { editWecomTags(row) {
this.wecomTag.instrumentId = null;
this.wecomTag.selectTagList = null;
// //
getWecomTagTree().then((response) => { getWecomTagTree().then((response) => {
this.wecomTag.optionTree = response.data this.wecomTag.optionTree = response.data
@ -1705,25 +1718,45 @@ export default {
if (row.wecomTagIds != null && row.wecomTagIds.length > 0) { if (row.wecomTagIds != null && row.wecomTagIds.length > 0) {
this.wecomTag.selectTagList = row.wecomTagIds.split(',').map(Number) this.wecomTag.selectTagList = row.wecomTagIds.split(',').map(Number)
} }
this.wecomTag.userId = row.id this.wecomTag.instrumentId = row.id
listInstrumentTag({
instrumentId: row.id,
type: 2
}).then((res) => {
if (res.code == 200 && res.data != null && res.data.length > 0) {
this.wecomTag.selectTagList = res.data.map(obj => obj.tagId);
}
})
}) })
}, },
/* 保存小程序标签 */ /* 保存小程序标签 */
submitMiniProgramTagList() { submitMiniProgramTagList() {
this.form.id = this.miniProgramTag.userId if (this.miniProgramTag.selectTagList == null || this.miniProgramTag.selectTagList.length == 0) {
this.form.miniTagIds = this.miniProgramTag.selectTagList.join(',') this.$message.warning(`请选择小程序标签`);
updateInstrument(this.form).then((response) => { return;
this.$modal.msgSuccess('修改成功') }
addInstrumentTag({
instrumentId: this.miniProgramTag.instrumentId,
tagIdList: this.miniProgramTag.selectTagList,
type: 1
}).then((response) => {
this.$modal.msgSuccess('操作成功')
this.miniProgramTag.visible = false this.miniProgramTag.visible = false
this.getList() this.getList()
}) })
}, },
/* 保存外部标签 */ /* 保存外部标签 */
submitWecomTagList() { submitWecomTagList() {
this.form.id = this.wecomTag.userId if (this.wecomTag.selectTagList == null || this.wecomTag.selectTagList.length == 0) {
this.form.wecomTagIds = this.wecomTag.selectTagList.join(',') this.$message.warning(`请选择外部标签`);
updateInstrument(this.form).then((response) => { return;
this.$modal.msgSuccess('修改成功') }
addInstrumentTag({
instrumentId: this.wecomTag.instrumentId,
tagIdList: this.wecomTag.selectTagList,
type: 2
}).then((response) => {
this.$modal.msgSuccess('操作成功')
this.wecomTag.visible = false this.wecomTag.visible = false
this.getList() this.getList()
}) })

Loading…
Cancel
Save