Commit df4c1fea by huaying

fix: 欢迎语

parent cb64dd55
......@@ -19,17 +19,26 @@ const staffActCodeRouter = [
{
path: '/actCodeAdd',
name: '新增活码',
component: _import('salesleads/actCodeManage/staffActCode/views', 'setActCode')
component: _import('salesleads/actCodeManage/staffActCode/views', 'setActCode'),
meta: {
keepAlive: true
}
},
{
path: '/actCodeEdit',
name: '编辑活码',
component: _import('salesleads/actCodeManage/staffActCode/views', 'setActCode')
component: _import('salesleads/actCodeManage/staffActCode/views', 'setActCode'),
meta: {
keepAlive: true
}
},
{
path: '/actCodeBatch',
name: '批量创建活码',
component: _import('salesleads/actCodeManage/staffActCode/views', 'batchAddCode')
component: _import('salesleads/actCodeManage/staffActCode/views', 'batchAddCode'),
meta: {
keepAlive: true
}
}
];
export default staffActCodeRouter;
......@@ -684,7 +684,8 @@ export default {
type: 'success',
message: '保存成功!'
});
this.$router.push('/salutatory');
// this.$router.push('/salutatory');
this.$router.go(-1);
}
})
.catch(function(error) {
......
......@@ -51,12 +51,22 @@ import { getRequest } from '@/api/api';
export default {
name: 'staffActCodeGroupList',
data() {
let exitName = (rule, value, callback) => {
let flag = this.namelist.map(item => item.interfaceName).includes(this.form.interfaceName);
if (flag == true) {
let exitName = async (rule, value, callback) => {
await getRequest('/haoban-manage3-web/hm/group/check/name', { groupName: this.groupListForm.groupName }).then(res => {
this.checkNameLength = res.data.result.length;
if (!this.isEditGroup) {
if (this.checkNameLength > 0) {
callback(new Error('该分组名称已存在,请重新输入'));
}
callback();
} else {
const editName = res.data.result.map(item => item.groupName);
if (this.checkNameLength > 0 && this.editNamePre != editName) {
callback(new Error('该分组名称已存在,请重新输入'));
}
callback();
}
});
};
return {
searchTip: false,
......@@ -83,7 +93,9 @@ export default {
groupName: '',
pageNum: 1,
pageSize: 20
}
},
checkNameLength: -1,
editNamePre: ''
};
},
created() {
......@@ -124,6 +136,7 @@ export default {
},
editGroupListItem(listItem) {
this.isEditGroup = true;
this.editNamePre = listItem.groupName;
this.$nextTick(() => {
this.$refs.groupListForm.clearValidate();
});
......
......@@ -94,10 +94,10 @@ export default {
...this.form
};
console.log(obj, '父组件,整体表单数据');
if (this.$route.query.id) {
if (this.$route.query.hmId) {
obj = {
...obj,
hm_id: this.detailCode.hmId
hm_id: this.$route.query.hmId
};
// 编辑
await postJsonRequest('/haoban-manage3-web/hm/qrcode/update', obj).then(res => {
......
......@@ -20,7 +20,7 @@
<dm-memberTag-group :visiable.sync="tagsDialogVisible" projectName="haobao-3" @save="saveTagPop"></dm-memberTag-group>
</el-form-item>
<dm-sub-title text="欢迎语设置" type="line" class="mt40b20" />
<welcomeItem @getWelcomeId="getWelcomeId"></welcomeItem>
<welcomeItem @getWelcomeId="getWelcomeId" :welcomeIdP="form.welcomeId"></welcomeItem>
</el-form>
</div>
<div class="saveBtn">
......
......@@ -59,9 +59,16 @@
<script>
import previewWelcome from '@/components/preview-welcome.vue';
import { postJsonRequest } from '@/api/api';
import { getRequest } from '../../../api/api';
export default {
name: 'welcomeItem',
components: { previewWelcome },
props: {
welcomeIdP: {
type: Object,
default: null
}
},
data() {
return {
welcomesType: 1,
......@@ -78,11 +85,14 @@ export default {
},
totalNum: 1,
welcomeId: '',
templateSelection: {}
templateSelection: {},
currentWelcome: [],
isFlag: false
};
},
created() {
mounted() {
this.getWelcomeTable();
console.log(this.welcomeIdP, 'ppp');
},
methods: {
onSearch() {
......@@ -100,13 +110,31 @@ export default {
await postJsonRequest('/haoban-manage3-web/welcome/list', this.welcomePage).then(res => {
this.welcomeTableData = res.data.result.result;
this.totalNum = res.data.result.totalCount;
if (this.isFlag) {
let flag = this.welcomeTableData.map(item => item.welcomeId).indexOf(this.currentWelcome.welcomeId);
let flag1 = this.welcomeTableData.map(item => item.welcomeId).includes(this.currentWelcome.welcomeId);
if (this.welcomePage.pageNum == 1) {
if (flag1) {
this.welcome = flag;
} else {
this.welcomeTableData.unshift(this.currentWelcome);
this.welcome = 0;
}
this.welcomeContent = this.currentWelcome.welcomeContent;
} else if (this.welcomePage.pageNum != 1) {
if (flag1) {
this.welcomeTableData.splice(flag, 1);
}
this.welcomeContent = '';
}
}
});
},
// 新建欢迎语
changeRoute() {
// this.$router.push({ path: '/salutatorySet' });
let routeUrl = this.$router.resolve({ path: '/salutatorySet', query: { type: 2 } });
window.open(routeUrl.href, '_blank');
this.$router.push({ path: '/salutatorySet', query: { type: 2 } });
// let routeUrl = this.$router.resolve({ path: '/salutatorySet', query: { type: 2 } });
// window.open(routeUrl.href, '_blank');
},
getCurrentRow(row) {
// 获取选中数据 row表示选中这一行的数据,可以从里面提取所需要的值
......@@ -122,6 +150,25 @@ export default {
this.$emit('getWelcomeId', this.welcomeId);
}
}
},
watch: {
welcomeIdP: {
handler: async function(val) {
if (val) {
console.log(val, 'id');
this.welcomeId = val;
await getRequest('/haoban-manage3-web/welcome/get', { welcomeId: this.welcomeId, enterpriseId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).enterpriseId : '' }).then(res => {
if (res.data.code == 0) {
this.currentWelcome = res.data.result || [];
this.isFlag = true;
this.getWelcomeTable();
}
});
}
},
immediate: true,
deep: true
}
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment