|
@@ -1,21 +1,34 @@
|
|
|
<template>
|
|
|
<div v-loading.fullscreen.lock="fullscreenLoading">
|
|
|
- <el-dialog width="1150px" class="pickupList-ai" title="Ai识别客户名单" :visible.sync="AiVisible">
|
|
|
- <div class="pickupList-ai-title">第一步:{{textToCopy}}<span @click="btn1">点击复制左侧文字</span></div>
|
|
|
+ <el-dialog width="400px" class="pickupList-ai" title="Ai识别客户名单" :visible.sync="AiVisible">
|
|
|
+ <!-- <div class="pickupList-ai-title">第一步:{{textToCopy}}<span @click="btn1">点击复制左侧文字</span></div>
|
|
|
<div class="pickupList-ai-title">第二步:打开<span @click="openkimi">KIMI</span>,将上述文字和截图粘贴到KIMI文本框里</div>
|
|
|
<div class="pickupList-ai-title">第三步:将KIMI生成的内容复制到以下文本框</div>
|
|
|
<div class="pickupList-ai-textarea">
|
|
|
- <el-input
|
|
|
- style="width:100%"
|
|
|
- type="textarea"
|
|
|
- :rows="15"
|
|
|
- placeholder="请输入内容"
|
|
|
- v-model="textarea">
|
|
|
+ <el-input style="width:100%" type="textarea" :rows="15" placeholder="请输入内容" v-model="textarea">
|
|
|
</el-input>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+ <div class="pickupList-ai-title">第一步:将文件添加至以下控件。</div>
|
|
|
+ <div class="pickupList-ai-title">第二步:点击AI识别。</div>
|
|
|
+ <div style="color:red;" class="pickupList-ai-title">注意!AI识别时间有点长,请耐心等待,勿进行其他操作。</div>
|
|
|
+ <el-upload
|
|
|
+ style="width: 100%;"
|
|
|
+ class="upload-demo"
|
|
|
+ drag
|
|
|
+ :file-list="AIfilelist"
|
|
|
+ action=""
|
|
|
+ :auto-upload="false"
|
|
|
+ :on-change="AIhttpRequest"
|
|
|
+ :on-remove="AIhttpRequest"
|
|
|
+ multiple>
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
+ <!-- <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div> -->
|
|
|
+ </el-upload>
|
|
|
<div class="pickupList-ai-btn">
|
|
|
- <el-button @click="recognizeclick" size="small" type="primary">识别</el-button>
|
|
|
- </div>
|
|
|
+ <el-button @click="AIrecognize" size="small" type="primary">AI识别</el-button>
|
|
|
+ <!-- <el-button @click="recognizeclick" size="small" type="primary">识别</el-button> -->
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
<div class="pickuplist-all">
|
|
|
<div class="pickuplist-head">
|
|
@@ -521,7 +534,8 @@ export default {
|
|
|
timeStamp: '',
|
|
|
AiVisible:false,
|
|
|
textToCopy:'按照“姓、名、姓名拼音、性别、单位、职务、出生日期”的json格式来排列整理(性别和出生日期通过身份证来识别,出生日期按照yyyy-MM-dd来整理)',
|
|
|
- textarea:""
|
|
|
+ textarea:"",
|
|
|
+ AIfilelist:[],
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -1302,6 +1316,95 @@ export default {
|
|
|
that.$message.error("下载失败!");
|
|
|
});
|
|
|
},
|
|
|
+ async AIhttpRequest(file, fileList) {
|
|
|
+ this.AIfilelist=fileList;
|
|
|
+ },
|
|
|
+ //ai识别
|
|
|
+ AIrecognize(){
|
|
|
+ if (this.AIfilelist.length === 0) {
|
|
|
+ return this.$message.warning('请选取文件后再识别!');
|
|
|
+ }
|
|
|
+ this.fullscreenLoading=true;
|
|
|
+ const formData = new FormData()
|
|
|
+ this.AIfilelist.forEach((file) => {
|
|
|
+ if (file.raw != undefined) {
|
|
|
+ formData.append('files', file.raw);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ var that = this;
|
|
|
+ var url = "/api/Groups/FileReadClient"
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: formData
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.$message.success(res.data.msg);
|
|
|
+ that.clearFileList(); // 上传成功后清空文件列表
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ that.AiVisible=false;
|
|
|
+ var dataarr = res.data.data.crmClients;
|
|
|
+ var dataarrnew = [];
|
|
|
+ for (var i = 0; i < dataarr.length; i++) {
|
|
|
+ dataarrnew.push(
|
|
|
+ {
|
|
|
+ lastName: dataarr[i].lastName,
|
|
|
+ firstName: dataarr[i].firstName,
|
|
|
+ pinyin: dataarr[i].pinyin,
|
|
|
+ sex: dataarr[i].sex == 0 ? '男' : '女',
|
|
|
+ isAccompany: '否',//陪同
|
|
|
+ companyFullName: dataarr[i].companyFullName,
|
|
|
+ job: dataarr[i].job,
|
|
|
+ idCardNo: dataarr[i].iDcard,
|
|
|
+ phone: dataarr[i].phone,
|
|
|
+ birthDay: dataarr[i].birthday == '-' ? '' : dataarr[i].birthday,
|
|
|
+ shippingSpaceTypeId: dataarr[i].berth,
|
|
|
+ shippingSpaceSpecialNeeds: '',
|
|
|
+ hotelSpecialNeeds: '',
|
|
|
+ mealSpecialNeeds: '',
|
|
|
+ remark: '',
|
|
|
+ }
|
|
|
+ )
|
|
|
+ // that.tourClientListInfos[i]=dataarrnew[i]
|
|
|
+ }
|
|
|
+ that.tourClientListInfos = dataarrnew
|
|
|
+ var len = 10 - dataarrnew.length
|
|
|
+ for (var jk = 0; jk < len; jk++) {
|
|
|
+ that.tourClientListInfos.push(
|
|
|
+ {
|
|
|
+ lastName: '',
|
|
|
+ firstName: "",
|
|
|
+ pinyin: '',
|
|
|
+ sex: '男',
|
|
|
+ isAccompany: '否',//陪同
|
|
|
+ companyFullName: "",
|
|
|
+ job: "",
|
|
|
+ idCardNo: "",
|
|
|
+ phone: "",
|
|
|
+ birthDay: "",
|
|
|
+ shippingSpaceTypeId: 460,
|
|
|
+ shippingSpaceSpecialNeeds: '',
|
|
|
+ hotelSpecialNeeds: '',
|
|
|
+ mealSpecialNeeds: '',
|
|
|
+ remark: '',
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ that.dialogTableVisible = true;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.data.msg);
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 清空文件列表
|
|
|
+ clearFileList() {
|
|
|
+ this.$refs.upload.clearFiles(); // 调用 el-upload 的 clearFiles 方法
|
|
|
+ this.AIfilelist = []; // 清空本地文件列表
|
|
|
+ },
|
|
|
async httpRequest(file, fileList) {
|
|
|
this.upLoadFile = []
|
|
|
for (let i in fileList) {
|
|
@@ -1397,7 +1500,6 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
- console.log(that.tourClientListInfos)
|
|
|
that.$message({
|
|
|
type: 'success',
|
|
|
message: res.data.msg,
|