|
@@ -3,28 +3,29 @@
|
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" :width="width" :before-close="handleClose">
|
|
|
<!-- 单个新增(事件) -->
|
|
|
<div v-if="type == 1">
|
|
|
- <el-form :model="formData[0]" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
|
|
+ <el-form :model="formData[0]" :rules="rules" ref="ruleForm" label-width="90px" label-position="left" class="demo-ruleForm">
|
|
|
<el-form-item label="事件名称" prop="questionName">
|
|
|
<el-autocomplete class="inline-input" v-model="formData[0].questionName"
|
|
|
:fetch-suggestions="querySearchQuestion"
|
|
|
placeholder="请输入或选择事件" :trigger-on-focus="false"
|
|
|
- @select="handleSelectQuestion" @change="change1($event, { $index: 0 })" @focus="focus($event, { $index: 0 })"
|
|
|
- @input="input1($event, {
|
|
|
- $index: 0,
|
|
|
- row: formData[0]
|
|
|
- })" style="width: 100%;">
|
|
|
+ @select="handleSelectQuestion" @blur="blur($event, { $index: 0 })" style="width: 100%;">
|
|
|
</el-autocomplete>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="所属客户" prop="clientId">
|
|
|
+ <el-select v-model="formData[0].clientId" :disabled="(formData[0].id && !this.row) ? true : false"
|
|
|
+ style="width: 100%;" placeholder="请选择客户">
|
|
|
+ <el-option
|
|
|
+ v-for="item in clientList"
|
|
|
+ :key="parseInt(item.value)" :label="item.label" :value="parseInt(item.value)">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="事件日期" prop="eventDate">
|
|
|
<el-date-picker style="width: 100%" v-model="formData[0].eventDate"
|
|
|
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="选择事件日期时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="事件描述" prop="description">
|
|
|
- <el-input type="textarea" :rows="1" v-model="formData[0].description" autocomplete="off" placeholder="请输入事件描述"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="事件场景" prop="assistPerson">
|
|
|
<el-select v-model="formData[0].applicationScenarios[0]" :disabled="(formData[0].id && !this.row) ? true : false"
|
|
|
style="width: 100%;" placeholder="请选择事件场景">
|
|
@@ -34,6 +35,10 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="事件描述" prop="description">
|
|
|
+ <el-input type="textarea" :rows="2" v-model="formData[0].description" autocomplete="off" placeholder="请输入事件描述"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<!-- 批量新增(事件) -->
|
|
@@ -51,7 +56,7 @@
|
|
|
<div>
|
|
|
<el-autocomplete class="inline-input" v-model="scope.row.questionName"
|
|
|
:fetch-suggestions="querySearchQuestion" placeholder="请输入或选择事件" :trigger-on-focus="false"
|
|
|
- @select="handleSelectQuestion" @focus="focus($event, scope)" style="width: 100%;">
|
|
|
+ @select="handleSelectQuestion" @blur="blur($event, scope)" style="width: 100%;">
|
|
|
</el-autocomplete>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -65,14 +70,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="description" label="事件描述" align="center" width="250px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <el-input type="textarea" :rows="1" v-model="scope.row.description" autocomplete="off"
|
|
|
- placeholder="请输入事件描述" :disabled="scope.row.id ? true : false"></el-input>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+
|
|
|
<el-table-column prop="applicationScenarios" label="事件场景" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
@@ -87,6 +85,14 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="description" label="事件描述" align="center" width="250px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-input type="textarea" :rows="1" v-model="scope.row.description" autocomplete="off"
|
|
|
+ placeholder="请输入事件描述" :disabled="scope.row.id ? true : false"></el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="事件操作" align="" width="100px">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
@@ -102,9 +108,9 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm1()" size="small" style="width:100px">确定</el-button>
|
|
|
- <el-button size="small" @click="resetForm()" style="width:100px">重置</el-button>
|
|
|
<el-button size="small" @click="handleClose()" style="width:100px">取消</el-button>
|
|
|
+ <el-button size="small" @click="resetForm()" style="width:100px">重置</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm1()" size="small" style="width:100px">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -139,6 +145,8 @@ export default {
|
|
|
commonData: {},
|
|
|
//弹窗类型
|
|
|
type: 1,
|
|
|
+ //客户集合
|
|
|
+ clientList:[]
|
|
|
}
|
|
|
},
|
|
|
watch: {},
|
|
@@ -298,7 +306,7 @@ export default {
|
|
|
deleteRow(row) {
|
|
|
this.formData.splice(row.$index, 1)
|
|
|
},
|
|
|
- // 查询所有事件
|
|
|
+ // 查询所有事件(不需要)
|
|
|
async questionEventList() {
|
|
|
await this.$api.eventQuery({}).then(res => {
|
|
|
if (res.code == 200) {
|
|
@@ -306,7 +314,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //获取下拉建议数据
|
|
|
+ //获取下拉建议数据(远程获取)
|
|
|
querySearchQuestion(queryString, cb) {
|
|
|
var restaurants = this.questionNameArr.map(item => {
|
|
|
item.value = item.questionName;
|
|
@@ -323,6 +331,7 @@ export default {
|
|
|
return (restaurant.value.indexOf(queryString) != -1);
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
// input框切换选择
|
|
|
handleSelectQuestion(val) {
|
|
|
let a = this.formData.findIndex(item => {
|
|
@@ -336,18 +345,12 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
},
|
|
|
- //失去焦点
|
|
|
- focus(ev, val) {
|
|
|
+
|
|
|
+ //失去焦点(远程找是否存在名称相同事件,如果存在就直接赋值)
|
|
|
+ blur(ev, val) {
|
|
|
|
|
|
},
|
|
|
- // input事件
|
|
|
- input1(ev, val) {
|
|
|
- // console.log(ev,val);
|
|
|
- },
|
|
|
- // change事件,input值改变触发
|
|
|
- change1(val) {
|
|
|
- // console.log(val);
|
|
|
- },
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -355,7 +358,7 @@ export default {
|
|
|
<style lang="scss">
|
|
|
.addEvent {
|
|
|
.dialog-footer {
|
|
|
- text-align: center;
|
|
|
+ // text-align: center;
|
|
|
}
|
|
|
}
|
|
|
|