Commit 5ee61a35 by 陈羽

update: 分配企业

parent 77859496
...@@ -20,13 +20,15 @@ ...@@ -20,13 +20,15 @@
<el-form-item label="AppID:" prop="appId"> <el-form-item label="AppID:" prop="appId">
<el-input show-word-limit placeholder="请输入AppID" type="text" v-model="ruleForm.appId" maxlength="80"></el-input> <el-input show-word-limit placeholder="请输入AppID" type="text" v-model="ruleForm.appId" maxlength="80"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="标题:" prop="title"> <template v-if="type === 1">
<el-input show-word-limit placeholder="请输入标题" type="text" v-model="ruleForm.title" maxlength="80"></el-input> <el-form-item label="标题:" prop="title">
</el-form-item> <el-input show-word-limit placeholder="请输入标题" type="text" v-model="ruleForm.title" maxlength="80"></el-input>
<el-form-item label=" 封面:" prop="pic"> </el-form-item>
<single-upload uploadType="1" :imgSrc.sync="ruleForm.pic" :field="''" class="app-set" :uploadLimit="20"> </single-upload> <el-form-item label=" 封面:" prop="pic">
<p style="margin-top: 9px;font-size: 12px;color: #909399;line-height: 17px;">建议尺寸520*416,支持png、jpg、jpeg格式</p> <single-upload uploadType="1" :imgSrc.sync="ruleForm.pic" :field="''" class="app-set" :uploadLimit="20"> </single-upload>
</el-form-item> <p style="margin-top: 9px;font-size: 12px;color: #909399;line-height: 17px;">建议尺寸520*416,支持png、jpg、jpeg格式</p>
</el-form-item>
</template>
</el-form> </el-form>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -48,6 +50,12 @@ export default { ...@@ -48,6 +50,12 @@ export default {
default() { default() {
return {}; return {};
} }
},
type: {
type: Number,
default() {
return 0;
}
} }
}, },
components: { components: {
......
...@@ -7,43 +7,51 @@ ...@@ -7,43 +7,51 @@
* @LastEditTime: 2021-04-12 15:57:24 * @LastEditTime: 2021-04-12 15:57:24
--> -->
<!-- <!--
<distribution-enterprise :id="enterpriseId" v-if="showDistribution" @closeText="closeText" @submitText="submitText"></distribution-enterprise> <el-button type="text" @click="toDistribute(scope.$index, scope.row)" v-if="!scope.row.fromMaterialId">分配企业</el-button>
<distribution-enterprise :editRow="distributionEditRow" :show="showDistribution" @closeText="closeTextDistribution" @submitText="submitTextDistribution"></distribution-enterprise>
<script> <script>
import distributionEnterprise from '@/components/set/distribution-enterprise.vue'; import distributionEnterprise from '@/components/set/distribution-enterprise.vue';
export default { export default {
data() { data() {
return { return {
enterpriseId:'', showDistribution: false,
showDistribution: false distributionEditRow: {}
}; };
}, },
methods: { methods: {
closeText() { closeTextDistribution() {
const that = this; this.showDistribution = false;
that.showDistribution = false; this.distributionEditRow = {};
that.editRow = {};
}, },
submitText() { submitTextDistribution() {
const that = this; const that = this;
that.showDistribution = false; that.showDistribution = false;
that.editRow = {}; that.distributionEditRow = {};
that.$emit('refreshTable'); that.$emit('refreshTable');
}, },
} toDistribute(index, row) {
this.showDistribution = true;
this.distributionEditRow = row;
},
},
components: {
distributionEnterprise
}
--> -->
<template> <template>
<el-dialog title="分配企业" :visible.sync="dialogVisible" width="490px" class="distribution-enterprise"> <el-dialog title="分配企业" :visible.sync="dialogVisible" width="490px" class="distribution-enterprise" @close="toCancel">
<div> <div>
<el-form :model="form" :rules="rules" ref="ruleForm" class="demo-ruleForm"> <el-form :model="form" :rules="rules" ref="ruleForm" class="demo-ruleForm">
<el-form-item> <el-form-item>
<p class="check-all"> <p class="check-all">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox> <el-checkbox v-model="checkAll" :disabled="hasCheckAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox>
</p> </p>
<el-form-item prop="checkedList"> <el-form-item prop="checkedList">
<el-checkbox-group v-model="form.checkedList" name="checkedList" @change="handleCheckedListChange"> <p v-if="!options.length" class="no-enterprise">暂无可分配企业</p>
<el-checkbox v-for="(opt, index) in options" name="checkedList" :label="opt.id" :key="index"> <el-checkbox-group v-else v-model="form.checkedList" name="checkedList" @change="handleCheckedListChange">
<p class="name">{{ opt.name }}</p> <el-checkbox v-for="(opt, index) in options" name="checkedList" :label="opt.wxEnterpriseId" :key="index" :disabled="opt.bindFlag">
<p class="subname">{{ opt.subname }}</p> <p class="name">{{ opt.enterpriseName }}</p>
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
...@@ -52,50 +60,51 @@ data() { ...@@ -52,50 +60,51 @@ data() {
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="toCancel">取消</el-button> <el-button @click="toCancel">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')">分配</el-button> <el-button type="primary" @click="submitForm('ruleForm')" :disabled="hasCheckAll">分配</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { _debounce } from '@/common/js/public'; import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api'; import { postRequest, getRequest } from '@/api/api';
import showMsg from '@/common/js/showmsg'; import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
const options = [
{ id: 1, name: '上海', subname: 'xiaosh' },
{ id: 2, name: '北京', subname: 'xiaosh' },
{ id: 3, name: '广州', subname: 'xiaosh' },
{ id: 4, name: '北京', subname: 'xiaosh' }
];
export default { export default {
props: { props: {
id: { editRow: {
type: String, type: Object,
default: '' default() {
return {};
}
}, },
show: { show: {
type: Boolean, type: Boolean,
default: false default() {
return false;
}
} }
}, },
data() { data() {
return { return {
dialogVisible: true, dialogVisible: false,
ruleForm: { ruleForm: {
enterpriseId: '' enterpriseId: ''
}, },
rules: { rules: {
checkedList: [{ type: 'array', required: true, message: '请选择企业', tigger: 'change' }] checkedList: [{ type: 'array', required: true, message: '请选择企业', tigger: 'change' }]
}, },
hasCheckAll: false,
checkAll: false, checkAll: false,
form: { checkedList: [] }, form: { checkedList: [] },
options, options: [],
isIndeterminate: false isIndeterminate: false
}; };
}, },
methods: { methods: {
toCancel() { toCancel() {
this.dialogVisible = false; this.$emit('closeText');
this.$refs['ruleForm'].resetFields();
}, },
submitForm: _debounce(function(formName) { submitForm: _debounce(function(formName) {
const that = this; const that = this;
...@@ -106,12 +115,12 @@ export default { ...@@ -106,12 +115,12 @@ export default {
}); });
}, 300), }, 300),
postSave() { postSave() {
showMsg.showmsg('操作成功', 'success');
this.$emit('submitText');
return;
const that = this; const that = this;
const data = { ...that.ruleForm }; let data = {
postRequest('/haoban-manage3-web/', data) materialIds: that.editRow.materialId,
toWxEnterpriseIds: that.form.checkedList.join(',')
};
postRequest('/haoban-manage3-web/material-share', data)
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
...@@ -130,36 +139,70 @@ export default { ...@@ -130,36 +139,70 @@ export default {
}, },
handleCheckAllChange(val) { handleCheckAllChange(val) {
if (val) { if (val) {
let arr = [];
this.options.map(item => { this.options.map(item => {
this.form.checkedList.push(item.id); arr.push(item.wxEnterpriseId);
}); });
this.form.checkedList = [...arr];
} else { } else {
this.form.checkedList = []; this.form.checkedList = [];
} }
this.isIndeterminate = false; this.isIndeterminate = false;
}, },
handleCheckedListChange(value) { handleCheckedListChange(value) {
this.form.checkedList = value;
let checkedCount = value.length; let checkedCount = value.length;
this.checkAll = checkedCount === this.options.length; this.checkAll = checkedCount === this.options.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.options.length; this.isIndeterminate = checkedCount > 0 && checkedCount < this.options.length;
}, },
getOptions() { getOptions() {
this.$refs['ruleForm'].resetFields(); const data = {
console.log(this.id); materialId: this.editRow.materialId
};
getRequest('/haoban-manage3-web/agent-wx-enterprise-list', data)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1 && resData.result && resData.result.length) {
let arr = [];
let options = resData.result.filter(item => {
if (arr.indexOf(item.wxEnterpriseId) === -1) {
if (item.bindFlag) {
this.form.checkedList.push(item.wxEnterpriseId);
}
arr.push(item.wxEnterpriseId);
return item;
}
});
if (this.form.checkedList.length === options.length) {
this.checkAll = true;
this.hasCheckAll = true;
}
this.options = [...options];
} else {
errMsg.errorMsg(resData);
}
})
.catch(error => {
this.$message.error({
duration: 1000,
message: error.message
});
});
} }
}, },
watch: { watch: {
show(newV, oldV) { show(newV, oldV) {
console.log(newV); this.dialogVisible = newV;
this.dialogVisible = true; },
editRow(newData) {
if (Object.keys(newData).length) {
this.getOptions();
}
} }
}, },
mounted() { mounted() {
const that = this; if (Object.keys(this.editRow).length) {
if (that.id) { this.getOptions();
that.$nextTick(() => {
this.getOptions();
});
} }
} }
}; };
...@@ -202,11 +245,6 @@ export default { ...@@ -202,11 +245,6 @@ export default {
line-height: 14px; line-height: 14px;
margin-bottom: 6px; margin-bottom: 6px;
} }
.subname {
font-size: 14px;
color: #909399;
line-height: 20px;
}
} }
} }
} }
...@@ -215,5 +253,10 @@ export default { ...@@ -215,5 +253,10 @@ export default {
padding-bottom: 20px; padding-bottom: 20px;
} }
} }
.no-enterprise {
height: 248px;
text-align: center;
color: #606266;
}
</style> </style>
<style lang="scss"></style> <style lang="scss"></style>
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toDistribute(scope.$index, scope.row)" v-if="!scope.row.fromMaterialId">分配企业</el-button>
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button> <el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template> </template>
...@@ -54,9 +55,11 @@ ...@@ -54,9 +55,11 @@
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination> <dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination>
</div> </div>
<file-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></file-edit> <file-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></file-edit>
<distribution-enterprise :editRow="distributionEditRow" :show="showDistribution" @closeText="closeTextDistribution" @submitText="submitTextDistribution"></distribution-enterprise>
</div> </div>
</template> </template>
<script> <script>
import distributionEnterprise from '@/components/set/distribution-enterprise.vue';
import fileEdit from '@/components/set/file-edit.vue'; import fileEdit from '@/components/set/file-edit.vue';
import { postRequest } from '@/api/api'; import { postRequest } from '@/api/api';
// import { _debounce } from '@/common/js/public'; // import { _debounce } from '@/common/js/public';
...@@ -106,7 +109,9 @@ export default { ...@@ -106,7 +109,9 @@ export default {
tableData: [], tableData: [],
multipleSelection: [], multipleSelection: [],
textShow: false, textShow: false,
editRow: {} editRow: {},
showDistribution: false,
distributionEditRow: {}
}; };
}, },
computed: {}, computed: {},
...@@ -128,6 +133,20 @@ export default { ...@@ -128,6 +133,20 @@ export default {
that.editRow = {}; that.editRow = {};
that.$emit('refreshTable'); that.$emit('refreshTable');
}, },
closeTextDistribution() {
this.showDistribution = false;
this.distributionEditRow = {};
},
submitTextDistribution() {
const that = this;
that.showDistribution = false;
that.distributionEditRow = {};
that.$emit('refreshTable');
},
toDistribute(index, row) {
this.showDistribution = true;
this.distributionEditRow = row;
},
/** /**
* 编辑 * 编辑
*/ */
...@@ -248,7 +267,8 @@ export default { ...@@ -248,7 +267,8 @@ export default {
} }
}, },
components: { components: {
fileEdit fileEdit,
distributionEnterprise
} }
}; };
</script> </script>
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toDistribute(scope.$index, scope.row)" v-if="!scope.row.fromMaterialId">分配企业</el-button>
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button> <el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template> </template>
...@@ -54,9 +55,11 @@ ...@@ -54,9 +55,11 @@
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination> <dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination>
</div> </div>
<image-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></image-edit> <image-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></image-edit>
<distribution-enterprise :editRow="distributionEditRow" :show="showDistribution" @closeText="closeTextDistribution" @submitText="submitTextDistribution"></distribution-enterprise>
</div> </div>
</template> </template>
<script> <script>
import distributionEnterprise from '@/components/set/distribution-enterprise.vue';
import imageEdit from '@/components/set/image-edit.vue'; import imageEdit from '@/components/set/image-edit.vue';
import { postRequest } from '@/api/api'; import { postRequest } from '@/api/api';
// import { _debounce } from '@/common/js/public'; // import { _debounce } from '@/common/js/public';
...@@ -106,7 +109,9 @@ export default { ...@@ -106,7 +109,9 @@ export default {
tableData: [], tableData: [],
multipleSelection: [], multipleSelection: [],
textShow: false, textShow: false,
editRow: {} editRow: {},
showDistribution: false,
distributionEditRow: {}
}; };
}, },
computed: {}, computed: {},
...@@ -125,6 +130,20 @@ export default { ...@@ -125,6 +130,20 @@ export default {
that.editRow = {}; that.editRow = {};
that.$emit('refreshTable'); that.$emit('refreshTable');
}, },
closeTextDistribution() {
this.showDistribution = false;
this.distributionEditRow = {};
},
submitTextDistribution() {
const that = this;
that.showDistribution = false;
that.distributionEditRow = {};
that.$emit('refreshTable');
},
toDistribute(index, row) {
this.showDistribution = true;
this.distributionEditRow = row;
},
/** /**
* 编辑 * 编辑
*/ */
...@@ -245,7 +264,8 @@ export default { ...@@ -245,7 +264,8 @@ export default {
} }
}, },
components: { components: {
imageEdit imageEdit,
distributionEnterprise
} }
}; };
</script> </script>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toDistribute(scope.$index, scope.row)">分配企业</el-button> <el-button type="text" @click="toDistribute(scope.$index, scope.row)" v-if="!scope.row.fromMaterialId">分配企业</el-button>
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button> <el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template> </template>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination> <dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination>
</div> </div>
<text-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></text-edit> <text-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></text-edit>
<distribution-enterprise :id="editRow.enterpriseId" :show="showDistribution" @closeText="closeTextDistribution" @submitText="submitTextDistribution"></distribution-enterprise> <distribution-enterprise :editRow="distributionEditRow" :show="showDistribution" @closeText="closeTextDistribution" @submitText="submitTextDistribution"></distribution-enterprise>
</div> </div>
</template> </template>
<script> <script>
...@@ -108,7 +108,8 @@ export default { ...@@ -108,7 +108,8 @@ export default {
multipleSelection: [], multipleSelection: [],
textShow: false, textShow: false,
editRow: {}, editRow: {},
showDistribution: false showDistribution: false,
distributionEditRow: {}
}; };
}, },
computed: {}, computed: {},
...@@ -128,25 +129,21 @@ export default { ...@@ -128,25 +129,21 @@ export default {
that.$emit('refreshTable'); that.$emit('refreshTable');
}, },
closeTextDistribution() { closeTextDistribution() {
const that = this; this.showDistribution = false;
that.showDistribution = false; this.distributionEditRow = {};
that.editRow = {};
}, },
submitTextDistribution() { submitTextDistribution() {
const that = this; const that = this;
that.showDistribution = false; that.showDistribution = false;
that.editRow = {}; that.distributionEditRow = {};
that.$emit('refreshTable'); that.$emit('refreshTable');
}, },
/** /**
* 编辑 * 编辑
*/ */
toDistribute(index, row) { toDistribute(index, row) {
console.log(1); this.showDistribution = true;
const that = this; this.distributionEditRow = row;
that.showDistribution = true;
that.editRow = row;
console.log(this.showDistribution);
}, },
/** /**
* 编辑 * 编辑
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toDistribute(scope.$index, scope.row)" v-if="!scope.row.fromMaterialId">分配企业</el-button>
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button> <el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template> </template>
...@@ -56,9 +57,11 @@ ...@@ -56,9 +57,11 @@
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination> <dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination>
</div> </div>
<video-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></video-edit> <video-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></video-edit>
<distribution-enterprise :editRow="distributionEditRow" :show="showDistribution" @closeText="closeTextDistribution" @submitText="submitTextDistribution"></distribution-enterprise>
</div> </div>
</template> </template>
<script> <script>
import distributionEnterprise from '@/components/set/distribution-enterprise.vue';
import videoEdit from '@/components/set/video-edit.vue'; import videoEdit from '@/components/set/video-edit.vue';
import { postRequest } from '@/api/api'; import { postRequest } from '@/api/api';
// import { _debounce } from '@/common/js/public'; // import { _debounce } from '@/common/js/public';
...@@ -108,7 +111,9 @@ export default { ...@@ -108,7 +111,9 @@ export default {
tableData: [], tableData: [],
multipleSelection: [], multipleSelection: [],
textShow: false, textShow: false,
editRow: {} editRow: {},
showDistribution: false,
distributionEditRow: {}
}; };
}, },
computed: {}, computed: {},
...@@ -130,6 +135,20 @@ export default { ...@@ -130,6 +135,20 @@ export default {
that.editRow = {}; that.editRow = {};
that.$emit('refreshTable'); that.$emit('refreshTable');
}, },
closeTextDistribution() {
this.showDistribution = false;
this.distributionEditRow = {};
},
submitTextDistribution() {
const that = this;
that.showDistribution = false;
that.distributionEditRow = {};
that.$emit('refreshTable');
},
toDistribute(index, row) {
this.showDistribution = true;
this.distributionEditRow = row;
},
/** /**
* 编辑 * 编辑
*/ */
...@@ -250,7 +269,8 @@ export default { ...@@ -250,7 +269,8 @@ export default {
} }
}, },
components: { components: {
videoEdit videoEdit,
distributionEnterprise
} }
}; };
</script> </script>
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toDistribute(scope.$index, scope.row)" v-if="!scope.row.fromMaterialId">分配企业</el-button>
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button> <el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template> </template>
...@@ -57,9 +58,11 @@ ...@@ -57,9 +58,11 @@
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination> <dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination>
</div> </div>
<web-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></web-edit> <web-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></web-edit>
<distribution-enterprise :editRow="distributionEditRow" :show="showDistribution" @closeText="closeTextDistribution" @submitText="submitTextDistribution"></distribution-enterprise>
</div> </div>
</template> </template>
<script> <script>
import distributionEnterprise from '@/components/set/distribution-enterprise.vue';
import webEdit from '@/components/set/web-edit.vue'; import webEdit from '@/components/set/web-edit.vue';
import { postRequest } from '@/api/api'; import { postRequest } from '@/api/api';
// import { _debounce } from '@/common/js/public'; // import { _debounce } from '@/common/js/public';
...@@ -109,7 +112,9 @@ export default { ...@@ -109,7 +112,9 @@ export default {
tableData: [], tableData: [],
multipleSelection: [], multipleSelection: [],
textShow: false, textShow: false,
editRow: {} editRow: {},
showDistribution: false,
distributionEditRow: {}
}; };
}, },
computed: {}, computed: {},
...@@ -128,6 +133,20 @@ export default { ...@@ -128,6 +133,20 @@ export default {
that.editRow = {}; that.editRow = {};
that.$emit('refreshTable'); that.$emit('refreshTable');
}, },
closeTextDistribution() {
this.showDistribution = false;
this.distributionEditRow = {};
},
submitTextDistribution() {
const that = this;
that.showDistribution = false;
that.distributionEditRow = {};
that.$emit('refreshTable');
},
toDistribute(index, row) {
this.showDistribution = true;
this.distributionEditRow = row;
},
/** /**
* 编辑 * 编辑
*/ */
...@@ -248,7 +267,8 @@ export default { ...@@ -248,7 +267,8 @@ export default {
} }
}, },
components: { components: {
webEdit webEdit,
distributionEnterprise
} }
}; };
</script> </script>
......
...@@ -122,9 +122,14 @@ export const constantRouterMap = [ ...@@ -122,9 +122,14 @@ export const constantRouterMap = [
component: _import('enterprise', 'material') component: _import('enterprise', 'material')
}, },
{ {
path: '/welcome', path: '/salutatory',
name: '素材库', name: '欢迎语',
component: _import('enterprise', 'material') component: _import('enterprise', 'salutatory')
},
{
path: '/salutatorySet',
name: '欢迎语',
component: _import('enterprise', 'salutatorySet')
} }
] ]
}, },
......
...@@ -149,12 +149,12 @@ ...@@ -149,12 +149,12 @@
<template slot-scope="scope"> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button><el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button> </template> <template slot-scope="scope"> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button><el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div v-if="tableData.length < 10" class="text-center add-cell cursor-pointer" @click="addApp"><span class="el-icon-plus font-14 color-2f54eb add-cell-txt"></span><span class="font-14 color-2f54eb p-l-5 add-cell-txt">新建</span><span class="font-12 color-c0c4cc p-l-20">最多添加10个</span></div> <div class="text-center add-cell cursor-pointer" @click="addApp"><span class="el-icon-plus font-14 color-2f54eb add-cell-txt"></span><span class="font-14 color-2f54eb p-l-5 add-cell-txt">新建</span><span class="font-12 color-c0c4cc p-l-20">最多添加10个</span></div>
</div> </div>
</div> </div>
</div> </div>
<secret-set v-if="addShow" :editRow="editRow" @closeText="closeText" @submitText="submitText"></secret-set> <secret-set v-if="addShow" :editRow="editRow" @closeText="closeText" @submitText="submitText"></secret-set>
<app-set v-if="addAppShow" @closeText="closeAppText" @submitText="submitAppText"></app-set> <app-set v-if="addAppShow" :type="appSetType" @closeText="closeAppText" @submitText="submitAppText"></app-set>
</div> </div>
</template> </template>
<script> <script>
...@@ -211,6 +211,7 @@ export default { ...@@ -211,6 +211,7 @@ export default {
tableData: [], tableData: [],
addShow: false, addShow: false,
addAppShow: false, addAppShow: false,
appSetType: 0,
editRow: {}, editRow: {},
// 企微好友 // 企微好友
wxShow: false, wxShow: false,
......
...@@ -60,6 +60,11 @@ export default { ...@@ -60,6 +60,11 @@ export default {
tabId: '3', tabId: '3',
tabName: '素材库', tabName: '素材库',
icon: 'iconsucaiku' icon: 'iconsucaiku'
},
{
tabId: '4',
tabName: '欢迎语',
icon: 'iconhuanyingci'
} }
], ],
activeBrand: '', // 商户(品牌) id activeBrand: '', // 商户(品牌) id
...@@ -113,6 +118,9 @@ export default { ...@@ -113,6 +118,9 @@ export default {
case '3': case '3':
that.changeRoute(`material`); that.changeRoute(`material`);
break; break;
case '4':
that.changeRoute(`salutatory`);
break;
} }
}, },
......
<template>
<div class="daily-set-wrap ">
<div class="daily-set-content border-box">
<div class="admin-tip-body">
<div role="alert" class="el-alert el-alert--info">
<i class="el-alert__icon el-icon-info"></i>
<div class="el-alert__content">
<p class="el-alert__title">
1. 因企业微信接口限制,若在企微管理端为相关人员配置欢迎语,好办设置欢迎语不会生效;<br />
2. 若使用好办欢迎语,请关闭其他企业自建应用/第三方应用的欢迎语配置; <br />
3. 欢迎语的业务场景是为了支持在代理商主体下的外部联系人与总部的会员能互联,暂不支持其他需求场景
</p>
</div>
</div>
</div>
<div class="salutatory-wrap m-t-20">
<div class="top">
<p class="left">欢迎语标题</p>
<p class="right"><span class="date">最近编辑时间:2021-03-26 12:22:33</span><el-button type="text" @click="changeRoute">编辑</el-button></p>
</div>
<p class="line"></p>
<div class="bottom">
<el-form label-width="83px" ref="form" :model="form">
<el-form-item label="文本内容">文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内 容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容</el-form-item>
<el-form-item label="附件">【好办welldown】文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
</template>
<script>
import { getRequest } from '@/api/api';
// import { _debounce } from '@/common/js/public';
// import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
export default {
props: {},
data() {
return {
form: {}
};
},
methods: {
/**
* 跳转
*/
changeRoute() {
this.$router.push('/salutatorySet');
},
/**
* 获取数据
*/
getData(val) {
const that = this;
let para = {
wxEnterpriseId: that.wxEnterpriseId
};
getRequest('/haoban-manage3-web/admin-list', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1 && resData.result) {
that.form = resData.result;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {},
mounted() {
const that = this;
that.$emit('showTab', 4);
document.documentElement.style.backgroundColor = '#f0f2f5';
that.getData();
},
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
components: {}
};
</script>
<style type="text/scss" lang="scss" scoped>
.bg-ebecf0 {
background: #ebecf0;
}
.color-c0c4cc {
display: inline-block;
line-height: 34px;
padding-left: 10px;
color: #c0c4cc;
}
.condition-tips {
display: inline-block;
vertical-align: middle;
line-height: 32px;
}
.p-l-30 {
padding-left: 30px;
}
.p-l-40 {
padding-left: 40px;
}
.p-l-55 {
padding-left: 55px;
}
.p-l-85 {
padding-left: 85px;
}
.m-l-20 {
margin-left: 20px;
}
.line-50 {
height: 50px;
line-height: 50px;
}
.el-alert--info {
align-items: flex-start;
width: 700px;
padding-top: 5px;
font-size: 14px;
color: #606266;
background: rgba(240, 245, 255, 1);
border-radius: 2px;
border: 1px solid rgba(133, 165, 255, 1);
}
.el-icon-info {
width: 12px;
font-size: 12px;
color: #2f54eb;
margin-top: 5px;
}
.el-alert__content {
padding-left: 9px;
.el-alert__title {
font-size: 13px;
font-weight: 400;
color: #303133;
line-height: 22px;
}
}
.daily-set-wrap {
height: 100%;
.daily-set-content {
padding: 20px;
.table-condition-left {
font-size: 0;
}
}
}
.salutatory-wrap {
height: 160px;
background: #f5f7fa;
.top {
display: flex;
justify-content: space-between;
align-items: center;
height: 47px;
padding: 0 20px 0 29px;
.left {
font-size: 14px;
font-weight: 600;
color: #303133;
line-height: 20px;
}
.right {
.date {
font-size: 12px;
font-weight: 400;
color: #909399;
line-height: 17px;
margin-right: 30px;
}
}
}
.line {
box-sizing: border-box;
border: 1px solid #e4e7ed;
border-style: none none solid none;
}
.bottom {
padding: 16px 20px 0 29px;
.el-form-item {
margin-bottom: 13px;
>>> .el-form-item__label {
padding: 0;
}
>>> .el-form-item__label,
>>> .el-form-item__content {
line-height: 20px;
font-size: 14px;
font-weight: 400;
color: #303133;
}
}
}
}
</style>
<template>
<div class="daily-set-wrap ">
<div class="daily-set-content border-box">
<div class="salutatory-set-wrap m-t-20">
<el-form label-width="100px" ref="form" :model="form">
<el-form-item label="欢迎语标题"> </el-form-item>
<el-form-item label="文本内容"> </el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
import { getRequest } from '@/api/api';
// import { _debounce } from '@/common/js/public';
// import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
export default {
props: {},
data() {
return {
form: {}
};
},
methods: {
/**
* 跳转
*/
changeRoute() {
this.$router.push('/contactsList');
},
/**
* 获取数据
*/
getData(val) {
const that = this;
let para = {
wxEnterpriseId: that.wxEnterpriseId
};
getRequest('/haoban-manage3-web/admin-list', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1 && resData.result) {
that.form = resData.result;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {},
mounted() {
const that = this;
that.$emit('showTab', 4);
document.documentElement.style.backgroundColor = '#f0f2f5';
that.getData();
},
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
components: {}
};
</script>
<style type="text/scss" lang="scss" scoped>
.bg-ebecf0 {
background: #ebecf0;
}
.color-c0c4cc {
display: inline-block;
line-height: 34px;
padding-left: 10px;
color: #c0c4cc;
}
.condition-tips {
display: inline-block;
vertical-align: middle;
line-height: 32px;
}
.p-l-30 {
padding-left: 30px;
}
.p-l-40 {
padding-left: 40px;
}
.p-l-55 {
padding-left: 55px;
}
.p-l-85 {
padding-left: 85px;
}
.m-l-20 {
margin-left: 20px;
}
.line-50 {
height: 50px;
line-height: 50px;
}
.el-alert--info {
align-items: flex-start;
width: 700px;
padding-top: 5px;
font-size: 14px;
color: #606266;
background: rgba(240, 245, 255, 1);
border-radius: 2px;
border: 1px solid rgba(133, 165, 255, 1);
}
.el-icon-info {
width: 12px;
font-size: 12px;
color: #2f54eb;
margin-top: 5px;
}
.el-alert__content {
padding-left: 9px;
.el-alert__title {
font-size: 13px;
font-weight: 400;
color: #303133;
line-height: 22px;
}
}
.daily-set-wrap {
height: 100%;
.daily-set-content {
padding: 20px;
.table-condition-left {
font-size: 0;
}
}
}
.salutatory-wrap {
height: 160px;
background: #f5f7fa;
.top {
display: flex;
justify-content: space-between;
align-items: center;
height: 47px;
padding: 0 20px 0 29px;
.left {
font-size: 14px;
font-weight: 600;
color: #303133;
line-height: 20px;
}
.right {
.date {
font-size: 12px;
font-weight: 400;
color: #909399;
line-height: 17px;
margin-right: 30px;
}
}
}
.line {
box-sizing: border-box;
border: 1px solid #e4e7ed;
border-style: none none solid none;
}
.bottom {
padding: 16px 20px 0 29px;
.el-form-item {
margin-bottom: 13px;
>>> .el-form-item__label {
padding: 0;
}
>>> .el-form-item__label,
>>> .el-form-item__content {
line-height: 20px;
font-size: 14px;
font-weight: 400;
color: #303133;
}
}
}
}
</style>
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,6 +6,20 @@ ...@@ -6,6 +6,20 @@
"description": "", "description": "",
"glyphs": [ "glyphs": [
{ {
"icon_id": "9702150",
"name": "欢迎辞",
"font_class": "huanyingci",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "17853642",
"name": "new",
"font_class": "new",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "15674954", "icon_id": "15674954",
"name": "明细备份", "name": "明细备份",
"font_class": "mingxibeifen", "font_class": "mingxibeifen",
......
No preview for this file type
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