Commit 3105b5ac by 杨明

fixed

1 parent 25b3db6f
......@@ -33,7 +33,7 @@
<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="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>
<template slot="taskStatus" slot-scope="scope">
<div :class="['task_icon', `task_icon${scope.scope.taskStatus}`]">{{ findStatus(scope.scope.taskStatus) }}</div>
......@@ -150,6 +150,7 @@ export default {
dialogVisibleDel: false,
autoSend: true,
taskName: '',
taskNum: 1,
url: '',
fileName: ''
}
......@@ -178,7 +179,7 @@ export default {
resolve()
})
},
setTableFinishFun(val) {
setTableFinishFun(val = []) {
this.taskNum = val.length
this.$refs.taskForm.data.length ? (this.$refs.taskForm.tableHeightValues = '') : this.$refs.taskForm.setTableHeightFun()
},
......
......@@ -332,7 +332,7 @@ export default {
this.staffInfo.splice(index, 1)
},
phoneCheck(fileName, url) {
this.$apis.aiCard.phoneCheck({ url }).then(res => {
this.$apis.aiCard.phoneCheck({ url, businessType: 0 }).then(res => {
if (res) {
this.ImportResult = res
if (res.error > 0) {
......@@ -380,7 +380,7 @@ export default {
if (item.attType == 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({
message: '最多输入10个兑换码',
type: 'error'
......@@ -403,7 +403,8 @@ export default {
taskName,
staffIds,
attachmentList,
autoSend
autoSend,
businessType: 0
}
if (this.isEdit) params.taskId = this.taskId
if (!this.isRedeem) return
......@@ -425,7 +426,7 @@ export default {
}
},
created() {
if(!util.isShowBtn(null,'兑换码')) {
if (!util.isShowBtn(null, '兑换码')) {
this.btnList.splice(-1)
}
}
......@@ -656,8 +657,8 @@ export default {
.gl-form-page .el-form {
padding-left: 0px !important;
}
.code-body-form /deep/ .w-textarea_input{
height:230px;
.code-body-form /deep/ .w-textarea_input {
height: 230px;
overflow-y: auto;
}
</style>
......@@ -5,7 +5,7 @@
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDel(scope.scope)" :disabled="scope.scope.taskStatus == 2 || scope.scope.taskStatus == 3">删除</el-button>
<el-button type="text" @click="goDetail(scope.scope)" v-if="activeIndex == 2">数据详情</el-button>
<el-button type="text" @click="goEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="goEdit(scope.scope)">编辑</el-button>
</div>
<template slot="taskStatus" slot-scope="scope">
<div :class="['task_icon', `task_icon${scope.scope.taskStatus}`]">{{ taskStatus(scope.scope.taskStatus) }}</div>
......@@ -214,6 +214,7 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm.taskStatus = this.activeIndex == 1 ? 1 : 4
this.tableSearchForm.businessType = 0
resolve()
})
},
......@@ -224,8 +225,8 @@ export default {
goDetail(scope) {
this.$router.push('/home/taskDetail?id=' + scope.id)
},
goEdit(data){
this.$emit('update',data)
goEdit(data) {
this.$emit('update', data)
}
}
}
......
......@@ -2,13 +2,13 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-07 14:22:41
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<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-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>
......@@ -83,7 +83,7 @@ const validateTime = (rule, value, callback) => {
const o = +value.match(/\s(\d+):/)[1]
if (o < 9 || o > 20) {
callback(new Error('请选择9:00-20:00时间段'))
}else {
} else {
callback()
}
}
......@@ -104,6 +104,7 @@ export default {
return new Date().getTime() - 24 * 60 * 60 * 1e3 > new Date(time).getTime()
}
},
loading: false,
aiOptions: [],
importVisible: false,
ImportResult: {},
......@@ -154,8 +155,10 @@ export default {
this.$emit('dialogClose')
},
handleSure() {
if(this.loading) return
this.$refs.addForm.validate(async valid => {
if (valid) {
this.loading = true
if (this.excelUrl && this.excelUrl != this.url) {
await this.$apis.aiCall.merchantTaskDelete({ taskId: this.addForm.taskId, deleteType: 1 })
this.addForm.taskId = null
......@@ -165,6 +168,7 @@ export default {
apiVal = 'updateTask'
}
this.$apis.aiCall[apiVal]({ ...this.addForm, url: this.url, businessType: 1 }).then(res => {
this.loading = false
if (res) this.$emit('dialogSure')
})
}
......
......@@ -100,9 +100,11 @@ export default {
},
handleJump(path) {
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
sessionStorage.setItem('isClick_AI', true)
localStorage.setItem('isClick_AI_USER', ai_user + ',' + userName)
return
}
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!