PickupList.vue 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697
  1. <template>
  2. <div v-loading.fullscreen.lock="fullscreenLoading">
  3. <el-dialog width="400px" class="pickupList-ai" title="Ai识别客户名单" :visible.sync="AiVisible" :close-on-click-modal="false">
  4. <!-- <div class="pickupList-ai-title">第一步:{{textToCopy}}<span @click="btn1">点击复制左侧文字</span></div>
  5. <div class="pickupList-ai-title">第二步:打开<span @click="openkimi">KIMI</span>,将上述文字和截图粘贴到KIMI文本框里</div>
  6. <div class="pickupList-ai-title">第三步:将KIMI生成的内容复制到以下文本框</div>
  7. <div class="pickupList-ai-textarea">
  8. <el-input style="width:100%" type="textarea" :rows="15" placeholder="请输入内容" v-model="textarea">
  9. </el-input>
  10. </div> -->
  11. <div class="pickupList-ai-title">第一步:将文件添加至以下控件。</div>
  12. <div class="pickupList-ai-title">第二步:点击AI识别。</div>
  13. <div style="color:red;" class="pickupList-ai-title">注意!AI识别时间有点长,请耐心等待,勿进行其他操作。</div>
  14. <el-upload
  15. style="width: 100%;"
  16. class="upload-demo"
  17. drag
  18. :file-list="AIfilelist"
  19. action=""
  20. :auto-upload="false"
  21. :on-change="AIhttpRequest"
  22. :on-remove="AIhttpRequest"
  23. multiple>
  24. <i class="el-icon-upload"></i>
  25. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  26. <!-- <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div> -->
  27. </el-upload>
  28. <div class="pickupList-ai-btn">
  29. <el-button @click="AIrecognize" size="small" type="primary">AI识别</el-button>
  30. <!-- <el-button @click="recognizeclick" size="small" type="primary">识别</el-button> -->
  31. </div>
  32. </el-dialog>
  33. <div class="pickuplist-all">
  34. <div class="pickuplist-head">
  35. <div class="pickuplist-head-li">
  36. <label>团组名称:</label>
  37. <el-select style="width:220px" @change="delegationSelectChange" v-model="diId" clearable filterable
  38. placeholder="请选择">
  39. <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.groupName"
  40. :value="item.id">
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <div class="pickuplist-info">
  45. <div class="pickuplist-info-li">
  46. <label>团 号:</label>
  47. <span>{{ GroupInfo.tourCode }}</span>
  48. </div>
  49. <div class="pickuplist-info-li">
  50. <label>客 户:</label>
  51. <span>{{ GroupInfo.clientName }}</span>
  52. </div>
  53. <div class="pickuplist-info-li">
  54. <label>出访国家:</label>
  55. <span>{{ GroupInfo.visitCountry | filter_city }}</span>
  56. </div>
  57. <div class="pickuplist-info-li">
  58. <label>起止日期:</label>
  59. <span>{{ GroupInfo.visitStartDate | filter_time }}~{{ GroupInfo.visitEndDate | filter_time
  60. }}</span>
  61. </div>
  62. <div class="pickuplist-info-li">
  63. <label>天数/人数:</label>
  64. <span>{{ GroupInfo.visitDays }}/{{ GroupInfo.visitPNumber }}</span>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="pickuplist-Upload-box">
  69. <el-button style="margin-right: 10px;" size="small" type="primary" @click="AIshibie">AI识别</el-button>
  70. <div slot="tip" class="el-upload__tip">只能识别jpg/png文件&nbsp;&nbsp;&nbsp;</div>
  71. <el-upload class="upload-demo" ref="upload" action="" :on-change="httpRequest" :on-remove="httpRequest"
  72. accept=".png, .jpg, .jpeg" :limit="1" :file-list="fileList" :auto-upload="false">
  73. <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
  74. <el-button style="margin-left: 10px;" size="small" type="success"
  75. @click="submitUpload">识别图片</el-button>
  76. </el-upload>
  77. </div>
  78. <div class="pickuplist-table">
  79. <el-table :data="tableData" border style="width: 100%">
  80. <el-table-column type="index" label="序号" width="55">
  81. </el-table-column>
  82. <el-table-column prop="lastName" label="姓" width="100">
  83. </el-table-column>
  84. <el-table-column prop="firstName" label="名" width="100">
  85. </el-table-column>
  86. <el-table-column prop="companyFullName" label="单位">
  87. </el-table-column>
  88. <el-table-column prop="job" label="职务">
  89. </el-table-column>
  90. <el-table-column prop="idCardNo" label="身份证" width="180">
  91. </el-table-column>
  92. <el-table-column prop="sex" label="性别" width="55">
  93. <template slot-scope="scope">
  94. {{ scope.row.sex == 0 ? '男' : '女' }}
  95. </template>
  96. </el-table-column>
  97. <el-table-column prop="isAccompany" label="是否陪同" width="80">
  98. <template slot-scope="scope">
  99. {{ scope.row.isAccompany == 1 ? '否' : '是' }}
  100. </template>
  101. </el-table-column>
  102. <el-table-column prop="operator" label="操作人" width="80">
  103. </el-table-column>
  104. <el-table-column label="操作" width="100">
  105. <template slot-scope="scope">
  106. <el-button @click.native.prevent="PostTourClientListDetails(scope.$index, scope.row)"
  107. type="text" size="small">
  108. 详细
  109. </el-button>
  110. <el-button @click.native.prevent="PostTourClientListDel(scope.$index, scope.row)"
  111. type="text" size="small">
  112. 删除
  113. </el-button>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. </div>
  118. <div class="pickuplist-btn">
  119. <div class="pickuplist-btn-lable">
  120. 详 情
  121. </div>
  122. <div>
  123. <el-button slot="trigger" @click="Exportlist(1)" type="primary">导出团组名单(英文)</el-button>
  124. <el-button slot="trigger" @click="Exportlist(0)" type="primary">导出团组名单</el-button>
  125. <el-button type="primary" @click="dialogTableVisible = true">添加多个资料</el-button>
  126. <el-button type="primary" @click="addhandoff">新增切换</el-button>
  127. <el-button type="primary" @click="preservation('pickupinif')">保存设置</el-button>
  128. </div>
  129. </div>
  130. <el-form :model="pickupinif" :rules="pickupinifRules" ref="pickupinif" label-width="110px"
  131. class="demo-OpHotelReservationsData pickuplist-form">
  132. <div style="display: flex;flex-wrap: wrap;">
  133. <div style="width:395px ;display: flex;">
  134. <el-form-item style="width:50% ;" label="姓" prop="surname">
  135. <el-autocomplete popper-class="el-autocomplete-suggestion" :popper-append-to-body="false"
  136. class="inline-input" size="medium" v-model.trim="pickupinif.surname"
  137. :fetch-suggestions="querySearch" @select="PromptChecked"
  138. @input="InputValue"></el-autocomplete>
  139. </el-form-item>
  140. <el-form-item label-width="50px" style="width:50% ;" label="名" prop="name">
  141. <el-input @input="InputValue" size="medium" type="text"
  142. v-model.trim="pickupinif.name"></el-input>
  143. </el-form-item>
  144. </div>
  145. <el-form-item style="width:395px ;" label="拼音" prop="Pinyin">
  146. <el-input size="medium" type="text" v-model.trim="pickupinif.Pinyin"></el-input>
  147. </el-form-item>
  148. <el-form-item style="width:395px ;" label="单位" prop="flats">
  149. <el-autocomplete style="width:100% ;" popper-class="el-autocomplete-suggestion"
  150. :popper-append-to-body="false" class="inline-input" size="medium"
  151. v-model.trim="pickupinif.flats" :fetch-suggestions="querySearchdw"></el-autocomplete>
  152. </el-form-item>
  153. <el-form-item style="width:395px ;" label="职务" prop="office">
  154. <el-input size="medium" type="text" v-model.trim="pickupinif.office"></el-input>
  155. </el-form-item>
  156. <el-form-item style="width:395px ;" label="性别">
  157. <el-radio-group v-model="pickupinif.gender">
  158. <el-radio label="男"></el-radio>
  159. <el-radio label="女"></el-radio>
  160. </el-radio-group>
  161. </el-form-item>
  162. <el-form-item style="width:395px ;" label="出生日期">
  163. <el-date-picker value-format="yyyy-MM-dd" size="medium" type="date" placeholder="选择出生日期"
  164. v-model.trim="pickupinif.birth" style="width: 100%;">
  165. </el-date-picker>
  166. </el-form-item>
  167. <el-form-item style="width:395px ;" label="舱位类型" prop="Accommodation">
  168. <el-select style="width:100%" v-model="pickupinif.Accommodation" clearable filterable
  169. placeholder="请选择">
  170. <el-option v-for="item in cangweiType" :key="item.id" :label="item.name" :value="item.id">
  171. </el-option>
  172. </el-select>
  173. </el-form-item>
  174. <el-form-item style="width:395px ;" label="是否陪同">
  175. <el-radio-group v-model="pickupinif.isAccompany">
  176. <el-radio label="是"></el-radio>
  177. <el-radio label="否"></el-radio>
  178. </el-radio-group>
  179. </el-form-item>
  180. <el-form-item style="width:395px ;" label="手机号">
  181. <el-input size="medium" type="text" v-model.trim="pickupinif.phone"></el-input>
  182. </el-form-item>
  183. <el-form-item style="width:395px ;" label="身份证">
  184. <el-input size="medium" type="text" v-model.trim="pickupinif.identity"></el-input>
  185. </el-form-item>
  186. </div>
  187. <el-form-item label="舱位备注">
  188. <el-input :rows="2" type="textarea" v-model="pickupinif.ClassRemarks"></el-input>
  189. </el-form-item>
  190. <el-form-item label="房间备注">
  191. <el-input :rows="2" type="textarea" v-model="pickupinif.Roomtype"></el-input>
  192. </el-form-item>
  193. <el-form-item label="餐食备注">
  194. <el-input :rows="2" type="textarea" v-model="pickupinif.Mealnotes"></el-input>
  195. </el-form-item>
  196. <el-form-item label="备注">
  197. <el-input :rows="2" type="textarea" v-model="pickupinif.remark"></el-input>
  198. </el-form-item>
  199. </el-form>
  200. <el-dialog class="dutzl" width="1392px" title="添加多条资料" :visible.sync="dialogTableVisible"
  201. :before-close="closeExpertFormDialog" :close-on-click-modal="false">
  202. <div class="dialog-hade">
  203. <label>PS:自动填写补全功能可能有误差请仔细核实,补全或修改(没有可用‘-’或‘暂无’代替)</label>
  204. <el-button @click="manysave" size="mini" type="primary">保 存</el-button>
  205. </div>
  206. <div class="yanzheng">
  207. <el-table :border="true" :data="tourClientListInfos">
  208. <el-table-column type="index" label="序号" width="50"></el-table-column>
  209. <el-table-column property="date" label="姓" width="100">
  210. <template slot-scope="scope">
  211. <el-autocomplete popper-class="el-autocomplete-suggestion"
  212. :popper-append-to-body="false" class="inline-input" size="mini"
  213. v-model.trim="scope.row.lastName" :fetch-suggestions="querySearch"
  214. @select="DTPromptChecked(scope.row)"></el-autocomplete>
  215. </template>
  216. </el-table-column>
  217. <el-table-column label="名" width="100">
  218. <template slot-scope="scope">
  219. <el-input size="mini" type="text" v-model.trim="scope.row.firstName">
  220. </el-input>
  221. </template>
  222. </el-table-column>
  223. <el-table-column label="单位" width="150">
  224. <template slot-scope="scope">
  225. <el-autocomplete style="width:100% ;" popper-class="el-autocomplete-suggestion"
  226. :popper-append-to-body="false" class="inline-input" size="mini"
  227. v-model.trim="scope.row.companyFullName"
  228. :fetch-suggestions="querySearchdw"></el-autocomplete>
  229. </template>
  230. </el-table-column>
  231. <el-table-column label="职务" width="150">
  232. <template slot-scope="scope">
  233. <el-input size="mini" type="text" v-model.trim="scope.row.job">
  234. </el-input>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="身份证" width="170">
  238. <template slot-scope="scope">
  239. <el-input size="mini" type="text" v-model.trim="scope.row.idCardNo">
  240. </el-input>
  241. </template>
  242. </el-table-column>
  243. <el-table-column label="手机号码" width="115">
  244. <template slot-scope="scope">
  245. <el-input size="mini" type="text" v-model.trim="scope.row.phone">
  246. </el-input>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="性别" width="150">
  250. <template slot-scope="scope">
  251. <el-radio-group size="mini" v-model="scope.row.sex">
  252. <el-radio label="男"></el-radio>
  253. <el-radio label="女"></el-radio>
  254. </el-radio-group>
  255. </template>
  256. </el-table-column>
  257. <el-table-column label="是否陪同" width="150">
  258. <template slot-scope="scope">
  259. <el-radio-group size="mini" v-model="scope.row.isAccompany">
  260. <el-radio label="是"></el-radio>
  261. <el-radio label="否"></el-radio>
  262. </el-radio-group>
  263. </template>
  264. </el-table-column>
  265. <el-table-column label="出生日期" width="100">
  266. <template slot-scope="scope">
  267. <el-date-picker value-format="yyyy-MM-dd" :clearable="false" size="mini" type="date"
  268. placeholder="出生日期" v-model.trim="scope.row.birthDay"
  269. style="width: 100%;padding-left: 0px;padding-right: 0px;">
  270. </el-date-picker>
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="舱位类型" width="115">
  274. <template slot-scope="scope">
  275. <el-select size="mini" style="width:100%" v-model="scope.row.shippingSpaceTypeId"
  276. clearable filterable placeholder="请选择">
  277. <el-option v-for="item in cangweiType" :key="item.id" :label="item.name"
  278. :value="item.id">
  279. </el-option>
  280. </el-select>
  281. </template>
  282. </el-table-column>
  283. </el-table>
  284. </div>
  285. </el-dialog>
  286. </div>
  287. </div>
  288. </template>
  289. <script>
  290. import { pinyin } from 'pinyin-pro';
  291. import { cl, el } from '@fullcalendar/core/internal-common';
  292. export default {
  293. data() {
  294. return {
  295. dialogTableVisible: false,
  296. tourClientListInfos: [
  297. {
  298. lastName: "",
  299. firstName: "",
  300. pinyin: '',
  301. sex: '男',
  302. isAccompany: '否',//陪同
  303. companyFullName: "",
  304. job: "",
  305. idCardNo: "",
  306. phone: "",
  307. birthDay: "",
  308. shippingSpaceTypeId: 460,
  309. shippingSpaceSpecialNeeds: '',
  310. hotelSpecialNeeds: '',
  311. mealSpecialNeeds: '',
  312. remark: '',
  313. },
  314. {
  315. lastName: "",
  316. firstName: "",
  317. pinyin: '',
  318. sex: '男',
  319. isAccompany: '否',//陪同
  320. companyFullName: "",
  321. job: "",
  322. idCardNo: "",
  323. phone: "",
  324. birthDay: "",
  325. shippingSpaceTypeId: 460,
  326. shippingSpaceSpecialNeeds: '',
  327. hotelSpecialNeeds: '',
  328. mealSpecialNeeds: '',
  329. remark: '',
  330. },
  331. {
  332. lastName: "",
  333. firstName: "",
  334. pinyin: '',
  335. sex: '男',
  336. isAccompany: '否',//陪同
  337. companyFullName: "",
  338. job: "",
  339. idCardNo: "",
  340. phone: "",
  341. birthDay: "",
  342. shippingSpaceTypeId: 460,
  343. shippingSpaceSpecialNeeds: '',
  344. hotelSpecialNeeds: '',
  345. mealSpecialNeeds: '',
  346. remark: '',
  347. },
  348. {
  349. lastName: "",
  350. firstName: "",
  351. pinyin: '',
  352. sex: '男',
  353. isAccompany: '否',//陪同
  354. companyFullName: "",
  355. job: "",
  356. idCardNo: "",
  357. phone: "",
  358. birthDay: "",
  359. shippingSpaceTypeId: 460,
  360. shippingSpaceSpecialNeeds: '',
  361. hotelSpecialNeeds: '',
  362. mealSpecialNeeds: '',
  363. remark: '',
  364. },
  365. {
  366. lastName: "",
  367. firstName: "",
  368. pinyin: '',
  369. sex: '男',
  370. isAccompany: '否',//陪同
  371. companyFullName: "",
  372. job: "",
  373. idCardNo: "",
  374. phone: "",
  375. birthDay: "",
  376. shippingSpaceTypeId: 460,
  377. shippingSpaceSpecialNeeds: '',
  378. hotelSpecialNeeds: '',
  379. mealSpecialNeeds: '',
  380. remark: '',
  381. },
  382. {
  383. lastName: "",
  384. firstName: "",
  385. pinyin: '',
  386. sex: '男',
  387. isAccompany: '否',//陪同
  388. companyFullName: "",
  389. job: "",
  390. idCardNo: "",
  391. phone: "",
  392. birthDay: "",
  393. shippingSpaceTypeId: 460,
  394. shippingSpaceSpecialNeeds: '',
  395. hotelSpecialNeeds: '',
  396. mealSpecialNeeds: '',
  397. remark: '',
  398. },
  399. {
  400. lastName: "",
  401. firstName: "",
  402. pinyin: '',
  403. sex: '男',
  404. isAccompany: '否',//陪同
  405. companyFullName: "",
  406. job: "",
  407. idCardNo: "",
  408. phone: "",
  409. birthDay: "",
  410. shippingSpaceTypeId: 460,
  411. shippingSpaceSpecialNeeds: '',
  412. hotelSpecialNeeds: '',
  413. mealSpecialNeeds: '',
  414. remark: '',
  415. },
  416. {
  417. lastName: "",
  418. firstName: "",
  419. pinyin: '',
  420. sex: '男',
  421. isAccompany: '否',//陪同
  422. companyFullName: "",
  423. job: "",
  424. idCardNo: "",
  425. phone: "",
  426. birthDay: "",
  427. shippingSpaceTypeId: 460,
  428. shippingSpaceSpecialNeeds: '',
  429. hotelSpecialNeeds: '',
  430. mealSpecialNeeds: '',
  431. remark: '',
  432. },
  433. {
  434. lastName: "",
  435. firstName: "",
  436. pinyin: '',
  437. sex: '男',
  438. isAccompany: '否',//陪同
  439. companyFullName: "",
  440. job: "",
  441. idCardNo: "",
  442. phone: "",
  443. birthDay: "",
  444. shippingSpaceTypeId: 460,
  445. shippingSpaceSpecialNeeds: '',
  446. hotelSpecialNeeds: '',
  447. mealSpecialNeeds: '',
  448. remark: '',
  449. },
  450. {
  451. lastName: "",
  452. firstName: "",
  453. pinyin: '',
  454. sex: '男',
  455. isAccompany: '否',//陪同
  456. companyFullName: "",
  457. job: "",
  458. idCardNo: "",
  459. phone: "",
  460. birthDay: "",
  461. shippingSpaceTypeId: 460,
  462. shippingSpaceSpecialNeeds: '',
  463. hotelSpecialNeeds: '',
  464. mealSpecialNeeds: '',
  465. remark: '',
  466. },
  467. ],
  468. token: '',
  469. pageId: '',
  470. userId: '',
  471. diId: '',
  472. delegationInfoList: [],
  473. tableData: [],
  474. GroupInfo: {},
  475. cangweiType: [],//舱位类型
  476. restaurants: [],//姓数组
  477. restaurantss: [],
  478. units: [],
  479. unit: [],//danwei数组
  480. id: 0,
  481. //必填参数
  482. pickupinif: {
  483. surname: '',//姓
  484. name: '',//名
  485. Pinyin: '',//拼音
  486. flats: '',//单位
  487. office: '',//职务
  488. phone: '',//手机号
  489. gender: '男',//性别
  490. isAccompany:'否',//是否陪同
  491. identity: '',//身份证
  492. birth: '',//出生日期
  493. Accommodation: '',//舱位类型
  494. ClassRemarks: '',//舱位备注
  495. Roomtype: '',//房间类型
  496. Mealnotes: '',//餐食备注
  497. remark: '',//备注
  498. },
  499. pickupinifRules: {
  500. surname: [
  501. { required: true, message: '请输入姓', trigger: ['blur', 'change'] }
  502. ],
  503. name: [
  504. { required: true, message: '请输入名', trigger: ['blur', 'change'] }
  505. ],
  506. Pinyin: [
  507. { required: true, message: '请输入拼音', trigger: ['blur', 'change'] }
  508. ],
  509. flats: [
  510. { required: true, message: '请选择单位', trigger: ['blur', 'change'] }
  511. ],
  512. office: [
  513. { required: true, message: '请输入职务', trigger: ['blur', 'change'] }
  514. ],
  515. phone: [
  516. { required: true, message: '请输入手机号', trigger: ['blur', 'change'] }
  517. ],
  518. gender: [
  519. { required: true, message: '请选择性别', trigger: ['blur', 'change'] }
  520. ],
  521. identity: [
  522. { required: true, message: '请输入身份证', trigger: ['blur', 'change'] }
  523. ],
  524. birth: [
  525. { required: true, message: '请选择出生日期', trigger: ['blur', 'change'] }
  526. ],
  527. Accommodation: [
  528. { required: true, message: '请选择舱位类型', trigger: ['blur', 'change'] }
  529. ],
  530. },
  531. fileList: [],
  532. upLoadFile: [],
  533. fullscreenLoading: false,
  534. timeStamp: '',
  535. AiVisible:false,
  536. textToCopy:'按照“姓、名、姓名拼音、性别、单位、职务、出生日期”的json格式来排列整理(性别和出生日期通过身份证来识别,出生日期按照yyyy-MM-dd来整理)',
  537. textarea:"",
  538. AIfilelist:[],
  539. }
  540. },
  541. methods: {
  542. //姓提示
  543. querySearch(queryString, cb) {
  544. var restaurants = this.restaurants;
  545. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
  546. // 调用 callback 返回建议列表的数据
  547. cb(results);
  548. },
  549. //danwei提示
  550. querySearchdw(queryString, cb) {
  551. var unit = this.unit;
  552. var results = queryString ? unit.filter(this.createFilter(queryString)) : unit;
  553. // 调用 callback 返回建议列表的数据
  554. cb(results);
  555. },
  556. createFilter(queryString) {
  557. return (restaurant) => {
  558. return restaurant.value.replace(" ", "").toLowerCase().match(queryString.toLowerCase());
  559. };
  560. },
  561. delegationSelectChange() {
  562. this.PostShareGroupInfo()
  563. this.addhandoff()
  564. },
  565. //点击复制
  566. btn1() {
  567. navigator.clipboard
  568. .writeText(this.textToCopy)
  569. .then(() => {
  570. this.$message.success("复制成功");
  571. })
  572. .catch((err) => {
  573. // 复制失败
  574. that.$message.error("复制失败");
  575. });
  576. },
  577. //打开kimi
  578. openkimi(){
  579. window.open("https://kimi.moonshot.cn");
  580. },
  581. //清空
  582. clearedlist() {
  583. this.tourClientListInfos = [
  584. {
  585. lastName: "",
  586. firstName: "",
  587. pinyin: '',
  588. sex: '男',
  589. isAccompany: '否',//陪同
  590. companyFullName: "",
  591. job: "",
  592. idCardNo: "",
  593. phone: "",
  594. birthDay: "",
  595. shippingSpaceTypeId: 460,
  596. shippingSpaceSpecialNeeds: '',
  597. hotelSpecialNeeds: '',
  598. mealSpecialNeeds: '',
  599. remark: '',
  600. },
  601. {
  602. lastName: "",
  603. firstName: "",
  604. pinyin: '',
  605. sex: '男',
  606. isAccompany: '否',//陪同
  607. companyFullName: "",
  608. job: "",
  609. idCardNo: "",
  610. phone: "",
  611. birthDay: "",
  612. shippingSpaceTypeId: 460,
  613. shippingSpaceSpecialNeeds: '',
  614. hotelSpecialNeeds: '',
  615. mealSpecialNeeds: '',
  616. remark: '',
  617. },
  618. {
  619. lastName: "",
  620. firstName: "",
  621. pinyin: '',
  622. sex: '男',
  623. isAccompany: '否',//陪同
  624. companyFullName: "",
  625. job: "",
  626. idCardNo: "",
  627. phone: "",
  628. birthDay: "",
  629. shippingSpaceTypeId: 460,
  630. shippingSpaceSpecialNeeds: '',
  631. hotelSpecialNeeds: '',
  632. mealSpecialNeeds: '',
  633. remark: '',
  634. },
  635. {
  636. lastName: "",
  637. firstName: "",
  638. pinyin: '',
  639. sex: '男',
  640. isAccompany: '否',//陪同
  641. companyFullName: "",
  642. job: "",
  643. idCardNo: "",
  644. phone: "",
  645. birthDay: "",
  646. shippingSpaceTypeId: 460,
  647. shippingSpaceSpecialNeeds: '',
  648. hotelSpecialNeeds: '',
  649. mealSpecialNeeds: '',
  650. remark: '',
  651. },
  652. {
  653. lastName: "",
  654. firstName: "",
  655. pinyin: '',
  656. sex: '男',
  657. isAccompany: '否',//陪同
  658. companyFullName: "",
  659. job: "",
  660. idCardNo: "",
  661. phone: "",
  662. birthDay: "",
  663. shippingSpaceTypeId: 460,
  664. shippingSpaceSpecialNeeds: '',
  665. hotelSpecialNeeds: '',
  666. mealSpecialNeeds: '',
  667. remark: '',
  668. },
  669. {
  670. lastName: "",
  671. firstName: "",
  672. pinyin: '',
  673. sex: '男',
  674. isAccompany: '否',//陪同
  675. companyFullName: "",
  676. job: "",
  677. idCardNo: "",
  678. phone: "",
  679. birthDay: "",
  680. shippingSpaceTypeId: 460,
  681. shippingSpaceSpecialNeeds: '',
  682. hotelSpecialNeeds: '',
  683. mealSpecialNeeds: '',
  684. remark: '',
  685. },
  686. {
  687. lastName: "",
  688. firstName: "",
  689. pinyin: '',
  690. sex: '男',
  691. isAccompany: '否',//陪同
  692. companyFullName: "",
  693. job: "",
  694. idCardNo: "",
  695. phone: "",
  696. birthDay: "",
  697. shippingSpaceTypeId: 460,
  698. shippingSpaceSpecialNeeds: '',
  699. hotelSpecialNeeds: '',
  700. mealSpecialNeeds: '',
  701. remark: '',
  702. },
  703. {
  704. lastName: "",
  705. firstName: "",
  706. pinyin: '',
  707. sex: '男',
  708. isAccompany: '否',//陪同
  709. companyFullName: "",
  710. job: "",
  711. idCardNo: "",
  712. phone: "",
  713. birthDay: "",
  714. shippingSpaceTypeId: 460,
  715. shippingSpaceSpecialNeeds: '',
  716. hotelSpecialNeeds: '',
  717. mealSpecialNeeds: '',
  718. remark: '',
  719. },
  720. {
  721. lastName: "",
  722. firstName: "",
  723. pinyin: '',
  724. sex: '男',
  725. isAccompany: '否',//陪同
  726. companyFullName: "",
  727. job: "",
  728. idCardNo: "",
  729. phone: "",
  730. birthDay: "",
  731. shippingSpaceTypeId: 460,
  732. shippingSpaceSpecialNeeds: '',
  733. hotelSpecialNeeds: '',
  734. mealSpecialNeeds: '',
  735. remark: '',
  736. },
  737. {
  738. lastName: "",
  739. firstName: "",
  740. pinyin: '',
  741. sex: '男',
  742. isAccompany: '否',//陪同
  743. companyFullName: "",
  744. job: "",
  745. idCardNo: "",
  746. phone: "",
  747. birthDay: "",
  748. shippingSpaceTypeId: 460,
  749. shippingSpaceSpecialNeeds: '',
  750. hotelSpecialNeeds: '',
  751. mealSpecialNeeds: '',
  752. remark: '',
  753. },
  754. ]
  755. },
  756. //获取团组
  757. GetGroupNameList() {
  758. var url = "/api/Business/GetGroupNameList"
  759. var that = this
  760. this.$axios({
  761. method: 'post',
  762. url: url,
  763. headers: {
  764. Authorization: 'Bearer ' + this.token
  765. },
  766. data: {
  767. portType: 1
  768. }
  769. }).then(function (res) {
  770. if (res.data.code == 200) {
  771. that.delegationInfoList = res.data.data;
  772. if (that.$route.query.id!=undefined) {
  773. that.diId=Number(that.$route.query.id);
  774. }else{
  775. that.diId = that.delegationInfoList[0].id;
  776. }
  777. that.PostShareGroupInfo();
  778. }
  779. }).catch(function (error) {
  780. that.$message.error("获取团组失败");
  781. });
  782. },
  783. //获取团组详情
  784. PostShareGroupInfo() {
  785. var url = "/api/Business/PostShareGroupInfo"
  786. var that = this
  787. this.$axios({
  788. method: 'post',
  789. url: url,
  790. headers: {
  791. Authorization: 'Bearer ' + this.token
  792. },
  793. data: {
  794. portType: 1,
  795. id: that.diId
  796. }
  797. }).then(function (res) {
  798. console.log(res)
  799. if (res.data.code == 200) {
  800. that.GroupInfo = res.data.data
  801. that.PostTourClientListByDiId()
  802. } else {
  803. that.$message.error(res.data.msg);
  804. }
  805. }).catch(function (error) {
  806. that.$message.error("获取团组详情失败!");
  807. });
  808. },
  809. //获取客户table
  810. PostTourClientListByDiId() {
  811. var url = "/api/Groups/PostTourClientListByDiId"
  812. var that = this
  813. this.$axios({
  814. method: 'post',
  815. url: url,
  816. headers: {
  817. Authorization: 'Bearer ' + this.token
  818. },
  819. data: {
  820. portType: 1,
  821. userId: that.userId,
  822. pageId: that.pageId,
  823. diId: that.diId,
  824. }
  825. }).then(function (res) {
  826. console.log(res)
  827. if (res.data.code == 200) {
  828. that.tableData = res.data.data;
  829. } else {
  830. that.$message.error(res.data.msg);
  831. }
  832. }).catch(function (error) {
  833. that.$message.error("获取接团名单失败!");
  834. });
  835. },
  836. //获取基础数据
  837. PostTourClientListBasicDataInit() {
  838. this.fullscreenLoading = true;
  839. var url = "/api/Groups/PostTourClientListBasicDataInit"
  840. var that = this
  841. this.$axios({
  842. method: 'post',
  843. url: url,
  844. headers: {
  845. Authorization: 'Bearer ' + this.token
  846. },
  847. data: {
  848. portType: 1,
  849. userId: that.userId,
  850. pageId: that.pageId,
  851. }
  852. }).then(function (res) {
  853. console.log(res)
  854. if (res.data.code == 200) {
  855. that.restaurantss = res.data.data.clientData;
  856. that.cangweiType = res.data.data.shippingSpaceTypeData;
  857. that.pickupinif.Accommodation = 460;
  858. that.units = res.data.data.clientCompanyData;
  859. that.restaurants = that.restaurantss.map((terminal) => {
  860. return {
  861. value: terminal.lastName + ' ' + terminal.firstName + ' ' + terminal.pinyin + ' ' + terminal.companyFullName + ' ' + terminal.job + ' ' + terminal.phone + ' ' + (terminal.sex == 0 ? '男' : '女') + ' ' + terminal.idCardNo + ' ' + (terminal.birthDay).split(' ')[0],
  862. };
  863. });
  864. that.unit = that.units.map((terminal) => {
  865. return {
  866. value: terminal.companyFullName,
  867. };
  868. });
  869. that.fullscreenLoading = false;
  870. }
  871. }).catch(function (error) {
  872. that.fullscreenLoading = false;
  873. that.$message.error("获取基础数据失败!");
  874. });
  875. },
  876. //提示选中
  877. PromptChecked() {
  878. console.log(this.pickupinif.surname.split(' '))
  879. var inif = this.pickupinif.surname.split(' ');
  880. this.pickupinif.surname = inif[0];
  881. this.pickupinif.name = inif[1];
  882. this.pickupinif.Pinyin = inif[2];
  883. if (this.pickupinif.Pinyin == '') {
  884. let surname = '';
  885. let surname1 = pinyin(this.pickupinif.surname, { toneType: 'none' }).toUpperCase();
  886. let surname2 = pinyin(this.pickupinif.name, { toneType: 'none' }).toUpperCase();
  887. surname = surname1 + '/' + surname2;
  888. this.pickupinif.Pinyin = surname;
  889. console.log(surname)
  890. }
  891. this.pickupinif.flats = inif[3];
  892. this.pickupinif.office = inif[4];
  893. this.pickupinif.phone = inif[5];
  894. this.pickupinif.gender = inif[6];
  895. this.pickupinif.identity = inif[7];
  896. this.pickupinif.birth = inif[8];
  897. },
  898. //添加多条提示选中
  899. DTPromptChecked(val) {
  900. console.log(val)
  901. var inif = val.lastName.split(' ');
  902. console.log(inif)
  903. val.lastName = inif[0] ? inif[0] : ''
  904. val.firstName = inif[1] ? inif[1] : ''
  905. val.companyFullName = inif[3] ? inif[3] : ''
  906. val.job = inif[4] ? inif[4] : ''
  907. val.idCardNo = inif[7] ? inif[7] : ''
  908. val.phone = inif[5] ? inif[5] : ''
  909. val.sex = inif[6] ? inif[6] : ''
  910. val.birthDay = inif[8] ? inif[8] : ''
  911. },
  912. //姓值改变
  913. ChangesValue() {
  914. console.log(this.pickupinif.surname)
  915. this.pickupinif.name = '';
  916. this.pickupinif.Pinyin = '';
  917. this.pickupinif.flats = '';
  918. this.pickupinif.office = '';
  919. this.pickupinif.phone = '';
  920. this.pickupinif.gender = '';
  921. this.pickupinif.identity = '';
  922. this.pickupinif.birth = '';
  923. if (this.$refs.pickupinif) {
  924. this.$nextTick(() => {
  925. this.$refs['pickupinif'].clearValidate();
  926. })
  927. }
  928. },
  929. //转换日期
  930. transferdate(val) {
  931. var today = new Date(val);
  932. var DD = String(today.getDate()).padStart(2, '0'); // 获取日
  933. var MM = String(today.getMonth() + 1).padStart(2, '0'); //获取月份,1 月为 0
  934. var yyyy = today.getFullYear(); // 获取年
  935. return yyyy + '-' + MM + '-' + DD
  936. },
  937. //输入
  938. InputValue() {
  939. let surname = '';
  940. let surname1 = pinyin(this.pickupinif.surname, { toneType: 'none' }).toUpperCase();
  941. let surname2 = pinyin(this.pickupinif.name, { toneType: 'none' }).toUpperCase();
  942. surname = surname1 + '/' + surname2;
  943. this.pickupinif.Pinyin = surname;
  944. console.log(surname)
  945. },
  946. //查询详情
  947. PostTourClientListDetails(index, row) {
  948. this.id = row.id;
  949. var url = "/api/Groups/PostTourClientListDetails"
  950. var that = this
  951. this.$axios({
  952. method: 'post',
  953. url: url,
  954. headers: {
  955. Authorization: 'Bearer ' + this.token
  956. },
  957. data: {
  958. portType: 1,
  959. userId: that.userId,
  960. pageId: that.pageId,
  961. id: row.id,
  962. }
  963. }).then(function (res) {
  964. console.log(res)
  965. if (res.data.code == 200) {
  966. that.pickupinif = {
  967. surname: res.data.data.lastName,//姓
  968. name: res.data.data.firstName,//名
  969. flats: res.data.data.companyFullName,//单位
  970. office: res.data.data.job,//职务
  971. phone: res.data.data.phone,//手机号
  972. gender: res.data.data.sex == 0 ? '男' : '女',//性别
  973. isAccompany: res.data.data.isAccompany == 1 ? '否' : '是',//性别
  974. identity: res.data.data.idCardNo,//身份证
  975. birth: res.data.data.birthDay,//出生日期
  976. Accommodation: res.data.data.shippingSpaceTypeId,//舱位类型
  977. ClassRemarks: res.data.data.shippingSpaceSpecialNeeds,//舱位备注
  978. Roomtype: res.data.data.hotelSpecialNeeds,//房间类型
  979. Mealnotes: res.data.data.mealSpecialNeeds,//餐食备注
  980. remark: res.data.data.remark,//备注
  981. };
  982. that.pickupinif.Pinyin = res.data.data.pinyin;//拼音
  983. if (that.pickupinif.Pinyin == '') {
  984. let surname = '';
  985. let surname1 = pinyin(that.pickupinif.surname, { toneType: 'none' }).toUpperCase();
  986. let surname2 = pinyin(that.pickupinif.name, { toneType: 'none' }).toUpperCase();
  987. surname = surname1 + '/' + surname2;
  988. that.pickupinif.Pinyin = surname;
  989. }
  990. } else {
  991. that.$message.error(res.data.msg);
  992. }
  993. }).catch(function (error) {
  994. that.$message.error("查询详情失败!");
  995. });
  996. },
  997. //保存
  998. preservation(formName) {
  999. this.$refs[formName].validate((valid) => {
  1000. if (valid) {
  1001. this.PostTourClientListAddOrEdit()
  1002. } else {
  1003. console.log('error submit!!');
  1004. return false;
  1005. }
  1006. });
  1007. },
  1008. //保存修改api
  1009. PostTourClientListAddOrEdit() {
  1010. let pdarr=[];
  1011. for (let k = 0; k < this.tableData.length; k++) {
  1012. if(this.tableData[k].isAccompany==1){
  1013. pdarr.push(this.tableData[k])
  1014. }
  1015. }
  1016. console.log(this.pickupinif.isAccompany);
  1017. if(pdarr.length>=this.GroupInfo.visitPNumber&&this.id==0&&this.pickupinif.isAccompany!="是"){
  1018. this.$message.error("保存失败!录入的客户名单超过本团组的出访人数,请检查仔细删除多余人!");
  1019. return
  1020. }
  1021. this.fullscreenLoading = true;
  1022. var url = "/api/Groups/PostTourClientListAddOrEdit"
  1023. var that = this
  1024. this.$axios({
  1025. method: 'post',
  1026. url: url,
  1027. headers: {
  1028. Authorization: 'Bearer ' + this.token
  1029. },
  1030. data: {
  1031. portType: 1,
  1032. userId: that.userId,
  1033. pageId: that.pageId,
  1034. diId: that.diId,
  1035. id: that.id,
  1036. lastName: that.pickupinif.surname,//姓
  1037. firstName: that.pickupinif.name,//名
  1038. pinyin: that.pickupinif.Pinyin,//姓名拼音
  1039. sex: that.pickupinif.gender == '男' ? 0 : 1,//性别 0 男1 女 其他值 未设置
  1040. isAccompany:that.pickupinif.isAccompany == '否' ? 1 : 2,
  1041. phone: that.pickupinif.phone,//手机号
  1042. companyFullName: that.pickupinif.flats,//公司名全称
  1043. job: that.pickupinif.office,//职位
  1044. idCardNo: that.pickupinif.identity,//身份证No
  1045. // tel:'',//...
  1046. birthDay: that.pickupinif.birth,//生日
  1047. shippingSpaceTypeId: that.pickupinif.Accommodation,//舱位类型(数据类型表Id)
  1048. shippingSpaceSpecialNeeds: that.pickupinif.ClassRemarks,//舱位特殊需求
  1049. hotelSpecialNeeds: that.pickupinif.Roomtype,//酒店特殊需求
  1050. mealSpecialNeeds: that.pickupinif.Mealnotes,//餐食特殊需求
  1051. remark: that.pickupinif.remark,//备注
  1052. }
  1053. }).then(function (res) {
  1054. console.log(res)
  1055. if (res.data.code == 200) {
  1056. that.$message({
  1057. type: 'success',
  1058. message: res.data.msg,
  1059. duration: '3000'
  1060. });
  1061. that.PostTourClientListByDiId();
  1062. setTimeout(() => {
  1063. that.addhandoff();
  1064. that.loading = false;
  1065. }, 500);
  1066. that.fullscreenLoading = false;
  1067. } else {
  1068. that.$message.error(res.data.msg);
  1069. that.fullscreenLoading = false;
  1070. }
  1071. }).catch(function (error) {
  1072. that.fullscreenLoading = false;
  1073. that.$message.error("保存或修改失败!");
  1074. });
  1075. },
  1076. //新增切换
  1077. addhandoff() {
  1078. this.id = 0;
  1079. this.pickupinif = {
  1080. surname: '',//姓
  1081. name: '',//名
  1082. Pinyin: '',//拼音
  1083. flats: '',//单位
  1084. office: '',//职务
  1085. phone: '',//手机号
  1086. gender: '男',//性别
  1087. isAccompany: '否',//陪同
  1088. identity: '',//身份证
  1089. birth: '',//出生日期
  1090. Accommodation: '',//舱位类型
  1091. ClassRemarks: '',//舱位备注
  1092. Roomtype: '',//房间类型
  1093. Mealnotes: '',//餐食备注
  1094. remark: '',//备注
  1095. };
  1096. if (this.$refs.pickupinif) {
  1097. this.$nextTick(() => {
  1098. this.$refs['pickupinif'].clearValidate();
  1099. })
  1100. }
  1101. this.PostTourClientListBasicDataInit()
  1102. },
  1103. //清空表单
  1104. closeExpertFormDialog(done) {
  1105. this.clearedlist()
  1106. done();//done 用于关闭 Dialog
  1107. },
  1108. //删除
  1109. PostTourClientListDel(index, row) {
  1110. this.$confirm('此操作将删除此条数据,是否确认', '提示', {
  1111. confirmButtonText: '确定',
  1112. cancelButtonText: '取消',
  1113. type: 'warning'
  1114. }).then(() => {
  1115. var url = "/api/Groups/PostTourClientListDel"
  1116. var that = this
  1117. this.$axios({
  1118. method: 'post',
  1119. url: url,
  1120. headers: {
  1121. Authorization: 'Bearer ' + this.token
  1122. },
  1123. data: {
  1124. portType: 1,
  1125. userId: that.userId,
  1126. pageId: that.pageId,
  1127. id: row.id,
  1128. }
  1129. }).then(function (res) {
  1130. console.log(res)
  1131. if (res.data.code == 200) {
  1132. that.$message({
  1133. type: 'success',
  1134. message: res.data.msg,
  1135. duration: '3000'
  1136. });
  1137. that.PostTourClientListByDiId();
  1138. } else {
  1139. that.$message.error(res.data.msg);
  1140. }
  1141. }).catch(function (error) {
  1142. that.$message.error("删除失败!");
  1143. });
  1144. }).catch(() => {
  1145. });
  1146. },
  1147. //识别
  1148. recognizeclick(){
  1149. let textarea=JSON.parse(this.textarea)
  1150. for (let i = 0; i < textarea.length; i++) {
  1151. textarea[i].lastName=textarea[i].姓;
  1152. delete textarea[i].姓;
  1153. textarea[i].firstName=textarea[i].名;
  1154. delete textarea[i].名;
  1155. textarea[i].companyFullName=textarea[i].单位;
  1156. delete textarea[i].单位;
  1157. textarea[i].birthDay=textarea[i].出生日期;
  1158. delete textarea[i].出生日期;
  1159. textarea[i].sex=textarea[i].性别;
  1160. delete textarea[i].性别;
  1161. textarea[i].job=textarea[i].职务;
  1162. delete textarea[i].职务;
  1163. textarea[i].pinyin=textarea[i].姓名拼音.replace(' ','/');
  1164. delete textarea[i].姓名拼音;
  1165. textarea[i].iDcard="-";
  1166. textarea[i].phone="-";
  1167. textarea[i].shippingSpaceTypeId=460;
  1168. textarea[i].remark="";
  1169. textarea[i].isAccompany='否';
  1170. }
  1171. console.log(textarea);
  1172. this.dialogTableVisible=true;
  1173. this.AiVisible=false;
  1174. this.tourClientListInfos = textarea
  1175. var len = 10 - textarea.length
  1176. for (var jk = 0; jk < len; jk++) {
  1177. this.tourClientListInfos.push(
  1178. {
  1179. lastName: '',
  1180. firstName: "",
  1181. pinyin: '',
  1182. sex: '男',
  1183. isAccompany: '否',//陪同
  1184. companyFullName: "",
  1185. job: "",
  1186. idCardNo: "",
  1187. phone: "",
  1188. birthDay: "",
  1189. shippingSpaceTypeId: 460,
  1190. shippingSpaceSpecialNeeds: '',
  1191. hotelSpecialNeeds: '',
  1192. mealSpecialNeeds: '',
  1193. remark: '',
  1194. }
  1195. )
  1196. }
  1197. },
  1198. //
  1199. AIshibie(){
  1200. this.AiVisible=true;
  1201. this.textarea='';
  1202. },
  1203. //多条保存
  1204. manysave(){
  1205. var tourClientList = [];
  1206. console.log(this.tourClientListInfos)
  1207. for (var i = 0; i < this.tourClientListInfos.length; i++) {
  1208. if (this.tourClientListInfos[i].lastName != "" && this.tourClientListInfos[i].firstName != "") {
  1209. tourClientList.push(this.tourClientListInfos[i])
  1210. }
  1211. }
  1212. tourClientList = JSON.parse(JSON.stringify(tourClientList))
  1213. for (var x = 0; x < tourClientList.length; x++) {
  1214. tourClientList[x].sex = tourClientList[x].sex == '男' ? 0 : 1
  1215. tourClientList[x].isAccompany = tourClientList[x].isAccompany == '否' ? 1 : 2
  1216. }
  1217. if (tourClientList) {
  1218. this.PostTourClientListAddMultiple(tourClientList)
  1219. }
  1220. },
  1221. //多存api
  1222. PostTourClientListAddMultiple(listinif) {
  1223. let pdarr=[];
  1224. let pdarrs=[];
  1225. for (let k = 0; k < this.tableData.length; k++) {
  1226. if(this.tableData[k].isAccompany==1){
  1227. pdarr.push(this.tableData[k])
  1228. }
  1229. }
  1230. for (let g = 0; g < listinif.length; g++) {
  1231. if(listinif[g].isAccompany==1){
  1232. pdarrs.push(listinif[g])
  1233. }
  1234. }
  1235. if((pdarr.length+pdarrs.length)>this.GroupInfo.visitPNumber){
  1236. this.$message.error("保存失败!录入的客户名单超过本团组的出访人数,请检查仔细删除多余人!");
  1237. return
  1238. }
  1239. var url = "/api/Groups/PostTourClientListAddMultiple"
  1240. var that = this
  1241. var data = {
  1242. portType: 1,
  1243. userId: that.userId,
  1244. pageId: that.pageId,
  1245. diId: that.diId,
  1246. tourClientListInfos: listinif
  1247. }
  1248. console.log(JSON.stringify(data))
  1249. this.$axios({
  1250. method: 'post',
  1251. url: url,
  1252. headers: {
  1253. Authorization: 'Bearer ' + this.token
  1254. },
  1255. data: {
  1256. portType: 1,
  1257. userId: that.userId,
  1258. pageId: that.pageId,
  1259. diId: that.diId,
  1260. tourClientListInfos: listinif
  1261. }
  1262. }).then(function (res) {
  1263. console.log(res)
  1264. if (res.data.code == 200) {
  1265. that.$message({
  1266. type: 'success',
  1267. message: res.data.msg,
  1268. duration: '3000'
  1269. });
  1270. that.PostTourClientListByDiId();
  1271. that.clearedlist();
  1272. that.dialogTableVisible = false;
  1273. } else {
  1274. that.$message.error(res.data.msg);
  1275. }
  1276. }).catch(function (error) {
  1277. that.$message.error("保存失败!");
  1278. });
  1279. },
  1280. //导出团组名单
  1281. Exportlist(val) {
  1282. var url = "/api/Groups/PostTourClientListDownloadFile"
  1283. var that = this
  1284. this.$axios({
  1285. method: 'post',
  1286. url: url,
  1287. headers: {
  1288. Authorization: 'Bearer ' + this.token
  1289. },
  1290. data: {
  1291. portType: 1,
  1292. userId: that.userId,
  1293. pageId: that.pageId,
  1294. diId: that.diId,
  1295. language: val
  1296. }
  1297. }).then(function (res) {
  1298. console.log(res)
  1299. if (res.data.code == 200) {
  1300. window.location.href = res.data.data
  1301. // that.$message({
  1302. // type: 'success',
  1303. // message: res.data.msg,
  1304. // duration:'3000'
  1305. // });
  1306. } else {
  1307. that.$message.error(res.data.msg);
  1308. }
  1309. }).catch(function (error) {
  1310. that.$message.error("下载失败!");
  1311. });
  1312. },
  1313. async AIhttpRequest(file, fileList) {
  1314. this.AIfilelist=fileList;
  1315. },
  1316. //ai识别
  1317. AIrecognize(){
  1318. if (this.AIfilelist.length === 0) {
  1319. return this.$message.warning('请选取文件后再识别!');
  1320. }
  1321. this.fullscreenLoading=true;
  1322. const formData = new FormData()
  1323. this.AIfilelist.forEach((file) => {
  1324. if (file.raw != undefined) {
  1325. formData.append('files', file.raw);
  1326. }
  1327. })
  1328. var that = this;
  1329. var url = "/api/Groups/FileReadClient"
  1330. this.$axios({
  1331. method: 'post',
  1332. url: url,
  1333. headers: {
  1334. Authorization: 'Bearer ' + that.token
  1335. },
  1336. data: formData
  1337. }).then(function (res) {
  1338. if (res.data.code == 200) {
  1339. that.$message.success(res.data.msg);
  1340. that.clearFileList(); // 上传成功后清空文件列表
  1341. that.fullscreenLoading=false;
  1342. that.AiVisible=false;
  1343. var dataarr = res.data.data.crmClients;
  1344. var dataarrnew = [];
  1345. for (var i = 0; i < dataarr.length; i++) {
  1346. dataarrnew.push(
  1347. {
  1348. lastName: dataarr[i].lastName,
  1349. firstName: dataarr[i].firstName,
  1350. pinyin: dataarr[i].pinyin,
  1351. sex:dataarr[i].sex==-1?'男':dataarr[i].sex == 0 ? '男' : '女',
  1352. isAccompany: '否',//陪同
  1353. companyFullName: dataarr[i].companyFullName,
  1354. job: dataarr[i].job,
  1355. idCardNo: dataarr[i].iDcard,
  1356. phone: dataarr[i].phone,
  1357. birthDay: dataarr[i].birthday == '-' ? '' : dataarr[i].birthday,
  1358. shippingSpaceTypeId: dataarr[i].berth,
  1359. shippingSpaceSpecialNeeds: '',
  1360. hotelSpecialNeeds: '',
  1361. mealSpecialNeeds: '',
  1362. remark: '',
  1363. }
  1364. )
  1365. // that.tourClientListInfos[i]=dataarrnew[i]
  1366. }
  1367. that.tourClientListInfos = dataarrnew
  1368. var len = 10 - dataarrnew.length
  1369. for (var jk = 0; jk < len; jk++) {
  1370. that.tourClientListInfos.push(
  1371. {
  1372. lastName: '',
  1373. firstName: "",
  1374. pinyin: '',
  1375. sex: '男',
  1376. isAccompany: '否',//陪同
  1377. companyFullName: "",
  1378. job: "",
  1379. idCardNo: "",
  1380. phone: "",
  1381. birthDay: "",
  1382. shippingSpaceTypeId: 460,
  1383. shippingSpaceSpecialNeeds: '',
  1384. hotelSpecialNeeds: '',
  1385. mealSpecialNeeds: '',
  1386. remark: '',
  1387. }
  1388. )
  1389. }
  1390. that.dialogTableVisible = true;
  1391. } else {
  1392. that.$message.error(res.data.msg);
  1393. that.fullscreenLoading=false;
  1394. }
  1395. }).catch(err => {
  1396. that.fullscreenLoading=false;
  1397. that.$message.error('识别出错,稍后再试!');
  1398. })
  1399. },
  1400. // 清空文件列表
  1401. clearFileList() {
  1402. this.$refs.upload.clearFiles(); // 调用 el-upload 的 clearFiles 方法
  1403. this.AIfilelist = []; // 清空本地文件列表
  1404. },
  1405. async httpRequest(file, fileList) {
  1406. this.upLoadFile = []
  1407. for (let i in fileList) {
  1408. this.upLoadFile[i] = await this.getBase64(fileList[i].raw)
  1409. }
  1410. console.log('上传文件列表', this.upLoadFile)
  1411. },
  1412. // 转base64码
  1413. getBase64(file) {
  1414. return new Promise((resolve, reject) => {
  1415. const reader = new FileReader()
  1416. let fileResult = ''
  1417. reader.readAsDataURL(file)
  1418. // 开始转
  1419. reader.onload = () => {
  1420. fileResult = reader.result
  1421. }
  1422. // 转 失败
  1423. reader.onerror = error => {
  1424. reject(error)
  1425. }
  1426. // 转 结束
  1427. reader.onloadend = () => {
  1428. resolve(fileResult)
  1429. }
  1430. })
  1431. },
  1432. submitUpload() {
  1433. console.log(this.upLoadFile)
  1434. if (this.upLoadFile.length == 0) {
  1435. this.$message.error("未选择图片!");
  1436. } else {
  1437. this.fullscreenLoading = true;
  1438. var url = "/api/BaiduOCR/ClientOCR"
  1439. var that = this
  1440. this.$axios({
  1441. method: 'post',
  1442. url: url,
  1443. headers: {
  1444. Authorization: 'Bearer ' + this.token
  1445. },
  1446. data: {
  1447. base64img: that.upLoadFile[0]
  1448. }
  1449. }).then(function (res) {
  1450. console.log(res)
  1451. if (res.data.code == 200) {
  1452. that.fullscreenLoading = false;
  1453. var dataarr = res.data.data;
  1454. var dataarrnew = [];
  1455. for (var i = 0; i < dataarr.length; i++) {
  1456. dataarrnew.push(
  1457. {
  1458. lastName: dataarr[i].lastName,
  1459. firstName: dataarr[i].firstName,
  1460. pinyin: dataarr[i].pinyin,
  1461. sex: dataarr[i].sex == 0 ? '男' : '女',
  1462. isAccompany: '否',//陪同
  1463. companyFullName: dataarr[i].companyFullName,
  1464. job: dataarr[i].job,
  1465. idCardNo: dataarr[i].iDcard,
  1466. phone: dataarr[i].phone,
  1467. birthDay: dataarr[i].birthday == '-' ? '' : dataarr[i].birthday,
  1468. shippingSpaceTypeId: dataarr[i].berth,
  1469. shippingSpaceSpecialNeeds: '',
  1470. hotelSpecialNeeds: '',
  1471. mealSpecialNeeds: '',
  1472. remark: '',
  1473. }
  1474. )
  1475. // that.tourClientListInfos[i]=dataarrnew[i]
  1476. }
  1477. that.tourClientListInfos = dataarrnew
  1478. var len = 10 - dataarrnew.length
  1479. for (var jk = 0; jk < len; jk++) {
  1480. that.tourClientListInfos.push(
  1481. {
  1482. lastName: '',
  1483. firstName: "",
  1484. pinyin: '',
  1485. sex: '男',
  1486. isAccompany: '否',//陪同
  1487. companyFullName: "",
  1488. job: "",
  1489. idCardNo: "",
  1490. phone: "",
  1491. birthDay: "",
  1492. shippingSpaceTypeId: 460,
  1493. shippingSpaceSpecialNeeds: '',
  1494. hotelSpecialNeeds: '',
  1495. mealSpecialNeeds: '',
  1496. remark: '',
  1497. }
  1498. )
  1499. }
  1500. that.$message({
  1501. type: 'success',
  1502. message: res.data.msg,
  1503. duration: '3000'
  1504. });
  1505. // setTimeout(function(){ that.dialogTableVisible=true; }, 3000); 
  1506. that.dialogTableVisible = true;
  1507. } else {
  1508. that.fullscreenLoading = false;
  1509. that.$message.error(res.data.msg);
  1510. }
  1511. }).catch(function (error) {
  1512. that.fullscreenLoading = false;
  1513. that.$message.error("导入失败!");
  1514. });
  1515. }
  1516. },
  1517. },
  1518. filters: {
  1519. filter_city(value) {
  1520. if (value) {
  1521. return value.replaceAll('|', '、')
  1522. }
  1523. },
  1524. filter_time(value) {
  1525. if (value) {
  1526. return value.split(" ")[0]
  1527. }
  1528. }
  1529. },
  1530. mounted() {
  1531. console.log(this.tourClientListInfos)
  1532. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  1533. this.pageId = 104;//页面id
  1534. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  1535. this.GetGroupNameList();
  1536. this.PostTourClientListBasicDataInit()
  1537. }
  1538. }
  1539. </script>
  1540. <style>
  1541. .pickuplist-all {
  1542. background-color: #fff;
  1543. padding: 10px;
  1544. box-shadow: 0 0 5px #0005;
  1545. border-radius: 10px;
  1546. height: 100%;
  1547. min-height: 830px;
  1548. min-width: 900px;
  1549. }
  1550. .pickuplist-all .block {
  1551. margin-top: 10px;
  1552. }
  1553. .pickuplist-head-li label {
  1554. color: #606266;
  1555. font-size: 15px;
  1556. font-weight: 600;
  1557. }
  1558. .pickuplist-head {
  1559. display: flex;
  1560. justify-content: space-between;
  1561. }
  1562. .pickuplist-info {
  1563. display: flex;
  1564. margin-top: 10px;
  1565. }
  1566. .pickuplist-info .pickuplist-info-li:last-child {
  1567. margin-right: 0;
  1568. }
  1569. .pickuplist-info-li {
  1570. margin-right: 30px;
  1571. }
  1572. .pickuplist-info-li label {
  1573. color: #606266;
  1574. font-size: 15px;
  1575. font-weight: 600;
  1576. }
  1577. .pickuplist-info-li span {
  1578. color: #606266;
  1579. font-size: 14px;
  1580. }
  1581. .pickuplist-Upload-box {
  1582. margin-top: 10px;
  1583. display: flex;
  1584. align-items: baseline;
  1585. justify-content: flex-end;
  1586. }
  1587. .pickuplist-Upload-box .upload-demo {
  1588. display: flex;
  1589. align-items: center;
  1590. }
  1591. .pickuplist-Upload-box .el-upload__tip {
  1592. margin-top: 0px;
  1593. }
  1594. .pickuplist-Upload-box .el-upload-list__item:first-child {
  1595. margin-top: 0px;
  1596. }
  1597. .pickuplist-table {
  1598. margin-top: 20px;
  1599. }
  1600. .pickuplist-btn {
  1601. margin-top: 30px;
  1602. padding-bottom: 10px;
  1603. display: flex;
  1604. justify-content: space-between;
  1605. align-items: center;
  1606. border-bottom: 1px solid #C0C4CC;
  1607. }
  1608. .pickuplist-btn-lable {
  1609. color: #606266;
  1610. font-size: 15px;
  1611. font-weight: 600;
  1612. }
  1613. .pickuplist-all .pickuplist-form {
  1614. margin-top: 20px;
  1615. }
  1616. .pickuplist-all .el-autocomplete-suggestion {
  1617. width: auto !important;
  1618. }
  1619. .pickuplist-all .yanzheng .el-input--prefix .el-input__inner{
  1620. padding-left: 0px;
  1621. padding-right: 0px;
  1622. }
  1623. .dutzl .el-input__inner {
  1624. padding: 0 5px;
  1625. }
  1626. .dutzl .el-date-editor .el-icon-date {
  1627. display: none;
  1628. }
  1629. .dialog-hade {
  1630. display: flex;
  1631. justify-content: space-between;
  1632. align-items: center;
  1633. margin-bottom: 10px;
  1634. }
  1635. .dialog-hade label {
  1636. color: red;
  1637. }
  1638. </style>
  1639. <style scoped>
  1640. .dutzl .el-dialog__body {
  1641. padding-top: 0;
  1642. }
  1643. .dutzl .el-dialog__title {
  1644. font-size: 17px;
  1645. font-weight: 600;
  1646. }
  1647. .dutzl .el-input--prefix .el-input__inner {
  1648. padding-left: 5px;
  1649. padding-right: 5px
  1650. }
  1651. .dutzl .el-table td.el-table__cell div,
  1652. .el-table th.el-table__cell>.cell {
  1653. text-align: left;
  1654. }
  1655. .pickupList-ai-title{
  1656. margin-bottom: 10px;
  1657. }
  1658. .pickupList-ai-title span{
  1659. color: #409eff;
  1660. cursor:pointer;
  1661. text-decoration: underline;
  1662. }
  1663. .pickupList-ai-btn{
  1664. text-align: right;
  1665. margin-top: 10px;
  1666. }
  1667. </style>