Commit 3105b5ac by 杨明

fixed

1 parent 25b3db6f
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDel(scope.scope)" v-if="scope.scope.taskStatus == 1">删除</el-button> <el-button type="text" @click="handleDel(scope.scope)" v-if="scope.scope.taskStatus == 1">删除</el-button>
<el-button type="text" @click="goDetail(scope.scope)">详情</el-button> <el-button type="text" @click="goDetail(scope.scope)">详情</el-button>
<el-button type="text" @click="handleAdd(scope.scope)" v-if="scope.scope.taskStatus != 4">编辑</el-button> <el-button type="text" @click="handleAdd(scope.scope)" v-if="scope.scope.taskStatus == 1">编辑</el-button>
</div> </div>
<template slot="taskStatus" slot-scope="scope"> <template slot="taskStatus" slot-scope="scope">
<div :class="['task_icon', `task_icon${scope.scope.taskStatus}`]">{{ findStatus(scope.scope.taskStatus) }}</div> <div :class="['task_icon', `task_icon${scope.scope.taskStatus}`]">{{ findStatus(scope.scope.taskStatus) }}</div>
...@@ -150,6 +150,7 @@ export default { ...@@ -150,6 +150,7 @@ export default {
dialogVisibleDel: false, dialogVisibleDel: false,
autoSend: true, autoSend: true,
taskName: '', taskName: '',
taskNum: 1,
url: '', url: '',
fileName: '' fileName: ''
} }
...@@ -178,7 +179,7 @@ export default { ...@@ -178,7 +179,7 @@ export default {
resolve() resolve()
}) })
}, },
setTableFinishFun(val) { setTableFinishFun(val = []) {
this.taskNum = val.length this.taskNum = val.length
this.$refs.taskForm.data.length ? (this.$refs.taskForm.tableHeightValues = '') : this.$refs.taskForm.setTableHeightFun() this.$refs.taskForm.data.length ? (this.$refs.taskForm.tableHeightValues = '') : this.$refs.taskForm.setTableHeightFun()
}, },
......
...@@ -332,7 +332,7 @@ export default { ...@@ -332,7 +332,7 @@ export default {
this.staffInfo.splice(index, 1) this.staffInfo.splice(index, 1)
}, },
phoneCheck(fileName, url) { phoneCheck(fileName, url) {
this.$apis.aiCard.phoneCheck({ url }).then(res => { this.$apis.aiCard.phoneCheck({ url, businessType: 0 }).then(res => {
if (res) { if (res) {
this.ImportResult = res this.ImportResult = res
if (res.error > 0) { if (res.error > 0) {
...@@ -380,7 +380,7 @@ export default { ...@@ -380,7 +380,7 @@ export default {
if (item.attType == 1) { if (item.attType == 1) {
item.attContent = item.attContent.replace(/\[(@昵称|#兑换码)\]/g, '$1') item.attContent = item.attContent.replace(/\[(@昵称|#兑换码)\]/g, '$1')
item.attContent = item.attContent.replace(/(@昵称|#兑换码)/g, '[$1]') item.attContent = item.attContent.replace(/(@昵称|#兑换码)/g, '[$1]')
if (item.attContent.match(/\[#兑换码\]/g)&&item.attContent.match(/\[#兑换码\]/g).length > 10) { if (item.attContent.match(/\[#兑换码\]/g) && item.attContent.match(/\[#兑换码\]/g).length > 10) {
this.$message({ this.$message({
message: '最多输入10个兑换码', message: '最多输入10个兑换码',
type: 'error' type: 'error'
...@@ -403,7 +403,8 @@ export default { ...@@ -403,7 +403,8 @@ export default {
taskName, taskName,
staffIds, staffIds,
attachmentList, attachmentList,
autoSend autoSend,
businessType: 0
} }
if (this.isEdit) params.taskId = this.taskId if (this.isEdit) params.taskId = this.taskId
if (!this.isRedeem) return if (!this.isRedeem) return
...@@ -425,7 +426,7 @@ export default { ...@@ -425,7 +426,7 @@ export default {
} }
}, },
created() { created() {
if(!util.isShowBtn(null,'兑换码')) { if (!util.isShowBtn(null, '兑换码')) {
this.btnList.splice(-1) this.btnList.splice(-1)
} }
} }
...@@ -656,8 +657,8 @@ export default { ...@@ -656,8 +657,8 @@ export default {
.gl-form-page .el-form { .gl-form-page .el-form {
padding-left: 0px !important; padding-left: 0px !important;
} }
.code-body-form /deep/ .w-textarea_input{ .code-body-form /deep/ .w-textarea_input {
height:230px; height: 230px;
overflow-y: auto; overflow-y: auto;
} }
</style> </style>
...@@ -214,6 +214,7 @@ export default { ...@@ -214,6 +214,7 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm.taskStatus = this.activeIndex == 1 ? 1 : 4 this.tableSearchForm.taskStatus = this.activeIndex == 1 ? 1 : 4
this.tableSearchForm.businessType = 0
resolve() resolve()
}) })
}, },
...@@ -224,8 +225,8 @@ export default { ...@@ -224,8 +225,8 @@ export default {
goDetail(scope) { goDetail(scope) {
this.$router.push('/home/taskDetail?id=' + scope.id) this.$router.push('/home/taskDetail?id=' + scope.id)
}, },
goEdit(data){ goEdit(data) {
this.$emit('update',data) this.$emit('update', data)
} }
} }
} }
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-07 14:22:41 * @Date: 2023-06-07 14:22:41
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-14 09:46:31 * @LastEditTime: 2023-06-14 15:33:20
* @FilePath: \scrm-micro-home\src\views\home\components\ai\addTask.vue * @FilePath: \scrm-micro-home\src\views\home\components\ai\addTask.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<GLDialog :title="!isEdit ? '创建任务' : '编辑任务'" okText="保存" class="gl-form-page gl-form-min" @onOk="handleSure" :before-close="handleClose" @onCancel="handleClose" :visible.sync="dialogVisibleTask"> <GLDialog :title="!isEdit ? '创建任务' : '编辑任务'" okText="保存" class="gl-form-page gl-form-min" @onOk="handleSure" :before-close="handleClose" @onCancel="handleClose" :visible.sync="dialogVisibleTask">
<el-form ref="addForm" :model="addForm" class="code-body-form" label-width="154px" :rules="addRules"> <el-form v-loading="loading" ref="addForm" :model="addForm" class="code-body-form" label-width="154px" :rules="addRules">
<el-form-item label="选择AI:" size="small" prop="robotId"> <el-form-item label="选择AI:" size="small" prop="robotId">
<el-select v-model="addForm.robotId" placeholder="请选择" @change="selectAI"> <el-select v-model="addForm.robotId" placeholder="请选择" @change="selectAI">
<el-option v-for="item in aiOptions" :key="item.robotId" :label="item.robotName" :value="item.robotId"></el-option> <el-option v-for="item in aiOptions" :key="item.robotId" :label="item.robotName" :value="item.robotId"></el-option>
...@@ -83,7 +83,7 @@ const validateTime = (rule, value, callback) => { ...@@ -83,7 +83,7 @@ const validateTime = (rule, value, callback) => {
const o = +value.match(/\s(\d+):/)[1] const o = +value.match(/\s(\d+):/)[1]
if (o < 9 || o > 20) { if (o < 9 || o > 20) {
callback(new Error('请选择9:00-20:00时间段')) callback(new Error('请选择9:00-20:00时间段'))
}else { } else {
callback() callback()
} }
} }
...@@ -104,6 +104,7 @@ export default { ...@@ -104,6 +104,7 @@ export default {
return new Date().getTime() - 24 * 60 * 60 * 1e3 > new Date(time).getTime() return new Date().getTime() - 24 * 60 * 60 * 1e3 > new Date(time).getTime()
} }
}, },
loading: false,
aiOptions: [], aiOptions: [],
importVisible: false, importVisible: false,
ImportResult: {}, ImportResult: {},
...@@ -154,8 +155,10 @@ export default { ...@@ -154,8 +155,10 @@ export default {
this.$emit('dialogClose') this.$emit('dialogClose')
}, },
handleSure() { handleSure() {
if(this.loading) return
this.$refs.addForm.validate(async valid => { this.$refs.addForm.validate(async valid => {
if (valid) { if (valid) {
this.loading = true
if (this.excelUrl && this.excelUrl != this.url) { if (this.excelUrl && this.excelUrl != this.url) {
await this.$apis.aiCall.merchantTaskDelete({ taskId: this.addForm.taskId, deleteType: 1 }) await this.$apis.aiCall.merchantTaskDelete({ taskId: this.addForm.taskId, deleteType: 1 })
this.addForm.taskId = null this.addForm.taskId = null
...@@ -165,6 +168,7 @@ export default { ...@@ -165,6 +168,7 @@ export default {
apiVal = 'updateTask' apiVal = 'updateTask'
} }
this.$apis.aiCall[apiVal]({ ...this.addForm, url: this.url, businessType: 1 }).then(res => { this.$apis.aiCall[apiVal]({ ...this.addForm, url: this.url, businessType: 1 }).then(res => {
this.loading = false
if (res) this.$emit('dialogSure') if (res) this.$emit('dialogSure')
}) })
} }
......
...@@ -100,9 +100,11 @@ export default { ...@@ -100,9 +100,11 @@ export default {
}, },
handleJump(path) { handleJump(path) {
if (path == '/home/aiCall') { if (path == '/home/aiCall') {
if (!sessionStorage.getItem('isClick_AI')) { const userName = this.$globalState.session.userName,
ai_user = localStorage.getItem('isClick_AI_USER')
if (!ai_user.includes(userName)) {
this.dialogVisible = true this.dialogVisible = true
sessionStorage.setItem('isClick_AI', true) localStorage.setItem('isClick_AI_USER', ai_user + ',' + userName)
return return
} }
this.$router.push(path) this.$router.push(path)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!