Commit 1d2c82e4 by xinla

--no commit message

1 parent 1bce1eea
......@@ -68,22 +68,6 @@ export default {
type || !data ? (this.disabled = false) : (this.disabled = true)
this.$emit('edit', data, type)
},
submit() {
this.$refs['form'].validate((valid) => {
if (valid) {
;(this.form.id ? update : add)(this.form)
.then(() => {
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList()
// this.getList(!this.form.id && 1)
})
.catch(() => {
this.dialogVisible = false
})
}
})
},
// 删除和撤销
removke(id, action, tip) {
// const operIds = id || this.ids + ''
......@@ -127,7 +111,7 @@ export default {
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="{ row }">
<el-button type="text" @click="edit(row, 'detail')">详情</el-button>
<el-button v-if="[0, 1].includes(row.status)" type="text" @click="edit(row, 'edit')">编辑</el-button>
<el-button v-if="['0', '1'].includes(row.status + '')" type="text" @click="edit(row, 'edit')">编辑</el-button>
<el-button v-if="row.status == 2" type="text" @click="removke(row.id, 'revoke', '撤回')">撤回</el-button>
<el-button v-else @click="removke(row.id, 'remove', '删除')" type="text">删除</el-button>
<!-- v-hasPermi="['customerManage:tag:remove']" -->
......
......@@ -29,6 +29,7 @@ export default {
formMsg: {},
dialogVisibleHistoryMsg: false,
dialogVisibleSendMsg: false,
disabled: false,
}
},
watch: {},
......@@ -179,7 +180,8 @@ export default {
<el-button
type="text"
@click="
agentId = item.agentId
formMsg.agentId = item.agentId
formMsg.agentName = item.name
dialogVisibleHistoryMsg = true
">
历史消息
......@@ -280,12 +282,13 @@ export default {
<el-dialog title="历史消息" :visible.sync="dialogVisibleHistoryMsg" :close-on-click-modal="false">
<HistoryMsg
ref="historyMsg"
:id="agentId"
:id="formMsg.agentId"
v-if="dialogVisibleHistoryMsg"
@edit="
(data) => {
(data, type) => {
dialogVisibleSendMsg = true
formMsg = data
disabled = type === 'detail'
formMsg = Object.assign({ agentId: formMsg.agentId, agentName: formMsg.agentName }, data)
}
" />
</el-dialog>
......@@ -301,7 +304,7 @@ export default {
<!-- 编辑/详情发送消息 弹窗 -->
<el-dialog title="发送消息" :visible.sync="dialogVisibleSendMsg" :close-on-click-modal="false">
<MsgForm v-if="dialogVisibleSendMsg" :data="formMsg" @submit="submitSendMsg" />
<MsgForm v-if="dialogVisibleSendMsg" :data="formMsg" :disabled="disabled" @submit="submitSendMsg" />
</el-dialog>
</div>
</template>
......
......@@ -14,6 +14,9 @@ export default {
type: Object,
default: () => ({}),
},
disabled: {
type: Boolean,
},
},
data() {
......@@ -212,7 +215,7 @@ export default {
</el-form>
</div>
<div class="mt20">
<div v-if="!disabled" class="mt20">
<el-button @click="$emit('submit')">取 消</el-button>
<el-button type="primary" @click="submit">确 定</el-button>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!