Commit 592dfa2a authored by yaobeibei's avatar yaobeibei

add changeAccountInfo

parent cf21df78
......@@ -1572,6 +1572,7 @@ app.post('/getAccount', async function (req, res) {
item.company = x.company
item.phone = x.phone
item.email = x.email
item.site = x.site
item.onelevelTag = x.onelevelTag || ''
item.twolevelTag = x.twolevelTag || ''
item.tag = { onelvtag: [], twolvtag: [] }
......@@ -1590,6 +1591,21 @@ app.post('/getAccount', async function (req, res) {
res.send({ status: 200, data: dataArr, dataTotal: dataArrTotal, emailArr: emailArr })
})
// 修改公司信息
app.post('/changeAccountInfo', async function (req, res) {
console.log(req.body)
let {accountID, name, phone, site} = req.body
await db.collection('account').update({_id: mongodb.ObjectId(accountID)}, {$set: {company: name, phone: phone, site: site}}, (err, response) => {
if (err) {
return console.log(err)
}
res.send({status: 200, message: '公司信息修改成功'})
})
})
// 向公司打标签
app.post('/makeAccountTag', async function(req, res){
console.log('进入打标签')
......@@ -2129,4 +2145,6 @@ app.post('/entryIn', function(req, res) {
})
module.exports = app
......@@ -29,6 +29,11 @@
<el-button type='text' @click='openForm(scope.row, scope.$index)' >公司标签</el-button>
</template>
</el-table-column>
<el-table-column label="修改公司信息">
<template slot-scope="scope">
<el-button type="text" @click="changeAccountInfo(scope)" >修改信息</el-button>
</template>
</el-table-column>
<el-table-column label='自动备案'>
<template slot-scope='scope'>
<el-switch
......@@ -67,6 +72,26 @@
style="float: right;margin-top: 15px">
</el-pagination>
</el-main>
<el-dialog title="修改公司信息" :visible.sync='changeAccountInfoDialog' width="40%">
<el-form :label-position="left" label-width="80px" :model="companyInfo" style="margin: 0 auto; width: 80%">
<el-form-item label="公司姓名">
<el-input v-model='companyInfo.name'></el-input>
</el-form-item>
<el-form-item label="公司电话">
<el-input v-model='companyInfo.phone'></el-input>
</el-form-item>
<el-form-item label="公司网站">
<el-input v-model='companyInfo.site'></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="changeAccountInfoDialog = false">取 消</el-button>
<el-button type="primary" @click="sureChangeInfo">确 定</el-button>
</div>
</el-dialog>
<el-dialog title='行业标签' :visible.sync='dialogVisiable' width=60%>
<el-select v-model="oneChoose" filterable clearable placeholder="请选择一级标签" @change='chooseOne'>
<el-option
......@@ -93,7 +118,7 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { mapGetters, mapActions } from 'vuex'
export default {
name: 'account',
data () {
......@@ -113,7 +138,14 @@
oneChoose: null,
twoChoose: null,
currentdata: null,
currentIndex: null
currentIndex: null,
changeAccountInfoDialog: false,
companyInfo: {
accountID: null,
name: null,
phone: null,
site: null
}
}
},
mounted () {
......@@ -127,6 +159,47 @@
})
},
methods: {
...mapActions({
send: 'SEND'
}),
changeAccountInfo (scope) {
this.currentdata = scope.row
this.currentIndex = scope.$index
this.companyInfo.accountID = this.currentdata._id
this.companyInfo.name = this.currentdata.company
this.companyInfo.phone = this.currentdata.phone
this.companyInfo.site = this.currentdata.site
this.changeAccountInfoDialog = true
},
sureChangeInfo () {
let self = this
console.log(this.companyInfo)
this.send({
url: '/api/changeAccountInfo',
choose: {
accountID: self.companyInfo.accountID,
name: self.companyInfo.name,
phone: self.companyInfo.phone,
site: self.companyInfo.site
},
callback: (err, data) => {
this.$message({
type: 'success',
message: data.message
})
self.changeAccountInfoDialog = false
self.currentdata.name = self.companyInfo.name
self.currentdata.phone = self.companyInfo.phone
self.currentdata.site = self.companyInfo.site
this.$set(self.datas, self.currentIndex, self.currentdata)
self.companyInfo.accountID = null
self.companyInfo.name = null
self.companyInfo.phone = null
self.companyInfo.site = null
}
})
},
makeAccountTag () {
this.dialogVisiable = false
let onelevelTag = this.onelevel[this.oneChoose]
......
......@@ -573,8 +573,9 @@
}).then(res => {
return res.json()
}).then(data => {
let datas = JSON.parse(data.datas)
if (data.status === 200) {
if (data.datas.ok === 1) {
if (datas.ok === 1) {
this.message({
type: 'success',
message: '录入成功'
......@@ -582,7 +583,7 @@
self.billID = null
self.statusDialog = false
} else {
this.$alert(data.datas.err, '录入失败', {
this.$alert(datas.err, '录入失败', {
confirmButtonText: '确定',
callback: action => {
this.$message({
......
<template>
<el-container>
<el-header>
<h4>短信审核</h4>
</el-header>
<el-main style="font-size: 12px">
<el-row>
<el-date-picker
......@@ -134,8 +131,7 @@
:total="total"
style="float: right;margin-top: 15px">
</el-pagination>
</el-main>
<el-dialog :visible.sync="dialogFormVisible">
<el-dialog :visible.sync="dialogFormVisible">
<p style="font-size: 16px;font-weight: 800">请添加筛选条件</p>
<p style='margin-left:10p'> 备注: {{meta}}</p>
<div>
......@@ -208,7 +204,8 @@
<el-button type="primary" @click="creatNoteTag()">确 定</el-button>
</div>
</el-dialog>
</el-container>
</el-main>
</template>
<script>
......
<template>
<el-container>
<el-header>
<h4>url审核</h4>
</el-header>
<el-main>
<el-row type="flex" justify="space-between" style="margin-bottom: 10px">
<el-col :span="8">
......@@ -23,7 +20,7 @@
</el-table>
<Pagination :currentPage='currentPage' :pageSize='pageSize' :total='total' @sizeChange='sizeChange' @currentChange='currentChange'></Pagination>
</el-main>
</el-container>
</template>
<script>
import DatePicker from './DatePicker'
......
<template>
<el-container>
<el-header>
<h4>导出任务</h4>
</el-header>
<el-main>
<el-table border :data='datas'>
<el-table-column label='任务编码' prop='taskID'></el-table-column>
......@@ -25,7 +22,7 @@
</span>
</el-dialog>
</el-main>
</el-container>
</template>
<script>
......
<template>
<el-container>
<el-header>
<h4>导入任务</h4>
</el-header>
<el-main>
<el-table border :data='datas'>
<el-table-column label='任务编码' prop='taskID'></el-table-column>
......@@ -13,7 +10,7 @@
<el-table-column label='导入来源公司' prop='fromCompany'></el-table-column>
</el-table>
</el-main>
</el-container>
</template>
<script>
......
<template>
<el-container>
<el-header>
<h4>代码位控制</h4>
</el-header>
<el-main>
<el-row>
<el-select v-model="inputValue" filterable placeholder="请选择账户名称" @change='change' clearable @clear='clear' style='width: 300px;margin-bottom: 10px'>
......@@ -55,8 +52,7 @@
:total="total"
style="float: right;margin-top: 15px">
</el-pagination>
</el-main>
<el-dialog title='备案规则' :visible.sync='dialogVisiable' width=60%>
<el-dialog title='备案规则' :visible.sync='dialogVisiable' width=60%>
<el-radio-group v-model="autoRule.strategy" @change='getChoose2' :disabled='currentdata.disable'>
<el-radio :label="'all'">全量备案</el-radio>
<el-radio :label="'repeat'">重复用户备案</el-radio>
......@@ -68,7 +64,9 @@
<el-button type="primary" @click="suerSend()" :disabled='currentdata.disable'>确 定</el-button>
</div>
</el-dialog>
</el-container>
</el-main>
</template>
<script>
......
<template>
<el-container>
<el-header>
<h4>用户营销池</h4>
</el-header>
<el-main>
<el-row style='margin-bottom: 10px'>
<el-button type='primary' style='float: left' @click=' inDialogVisible = true'>导入任务</el-button>
......@@ -159,7 +156,7 @@
</span>
</el-dialog>
</el-main>
</el-container>
</template>
<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