OpOfficialActivities.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  1. <template>
  2. <div class="car_add visit-box">
  3. <div>
  4. <div class="communal-title">
  5. <div>{{ title }}</div>
  6. </div>
  7. <div class="ps-title">PS:"请规范录入,未规范录入,造成公司损失或影响提成计算,需承担责任"</div>
  8. </div>
  9. <hr style='background-color:#5555; height:1px; border:none;margin: 8px 0;' />
  10. <div>
  11. <el-form :model="delegationInfo" label-width="100px" class="demo-ruleForm">
  12. <div style="display: flex;flex-wrap: wrap;">
  13. <div style="width: 385px;">
  14. <el-form-item label="团组名称:" label-width="160px">
  15. <el-select v-model="DiId" clearable filterable placeholder="团组选择" @change="DiIdChang"
  16. :disabled="isShow">
  17. <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
  18. :value="item.id">
  19. </el-option>
  20. </el-select>
  21. </el-form-item>
  22. </div>
  23. <div style="width: 385px;">
  24. <el-form-item label="团 号:" prop="tourCode" label-width="160px">
  25. <el-input placeholder="团号" v-model="delegationInfo.tourCode" :disabled="true">
  26. </el-input>
  27. </el-form-item>
  28. </div>
  29. <div style="width: 385px;">
  30. <el-form-item label="客户:" prop="clientName" label-width="160px">
  31. <el-input placeholder="客户" v-model="delegationInfo.clientName" :disabled="true">
  32. </el-input>
  33. </el-form-item>
  34. </div>
  35. <div style="width: 385px;">
  36. <el-form-item label="出访国家:" prop="visitCountry" label-width="160px">
  37. <el-input placeholder="出访国家" v-model="delegationInfo.visitCountry" :disabled="true">
  38. </el-input>
  39. </el-form-item>
  40. </div>
  41. </div>
  42. </el-form>
  43. <el-form :model="OpOfficialActivitiesDto" ref="OpOfficialActivitiesDto" :rules="OpOfficialActivitiesRules"
  44. label-width="100px" class="demo-ruleForm">
  45. <div style="display: flex;flex-wrap: wrap;">
  46. <div style="width: 385px;">
  47. <el-form-item label="国家:" prop="country" label-width="160px">
  48. <el-input clearable placeholder="国家" v-model="OpOfficialActivitiesDto.country">
  49. </el-input>
  50. </el-form-item>
  51. </div>
  52. <div style="width: 385px;">
  53. <el-form-item label="地区:" prop="area" label-width="160px">
  54. <el-input clearable placeholder="地区" v-model="OpOfficialActivitiesDto.area">
  55. </el-input>
  56. </el-form-item>
  57. </div>
  58. <div style="width: 385px;">
  59. <el-form-item label="公务单位:" prop="client" label-width="160px">
  60. <el-input clearable placeholder="公务单位" v-model="OpOfficialActivitiesDto.client">
  61. </el-input>
  62. </el-form-item>
  63. </div>
  64. <div style="width: 385px;">
  65. <el-form-item label="公务日期:" prop="date" label-width="160px">
  66. <el-date-picker
  67. type="date"
  68. v-model="OpOfficialActivitiesDto.date"
  69. placeholder="选择日期">
  70. </el-date-picker>
  71. </el-form-item>
  72. </div>
  73. <div style="width: 385px;">
  74. <el-form-item label="公务时刻:" prop="time" label-width="160px">
  75. <el-time-picker v-model="OpOfficialActivitiesDto.time" format='HH:mm' value-format="HH:mm"
  76. placeholder="公务时刻">
  77. </el-time-picker>
  78. </el-form-item>
  79. </div>
  80. <div style="width: 385px;">
  81. <el-form-item label="邀请方:" prop="type" label-width="160px">
  82. <el-select v-model="OpOfficialActivitiesDto.type" clearable filterable placeholder="邀请方选择">
  83. <el-option v-for="item in yqfarr" :key="item.id" :label="item.name"
  84. :value="item.id">
  85. </el-option>
  86. </el-select>
  87. <!-- <el-radio-group v-model="OpOfficialActivitiesDto.type">
  88. <el-radio :label=1>是</el-radio>
  89. <el-radio :label=0>否</el-radio>
  90. </el-radio-group> -->
  91. </el-form-item>
  92. </div>
  93. <!-- </div>
  94. <div style="display: flex;flex-wrap: wrap;"> -->
  95. <div style="width: 385px;">
  96. <el-form-item label="公务方联系人职务:" prop="job" label-width="160px">
  97. <el-input clearable placeholder="公务方联系人职务" v-model="OpOfficialActivitiesDto.job">
  98. </el-input>
  99. </el-form-item>
  100. </div>
  101. <div style="width: 385px;">
  102. <el-form-item label="公务方联系人:" prop="contact" label-width="160px">
  103. <el-input clearable placeholder="公务方联系人" v-model="OpOfficialActivitiesDto.contact">
  104. </el-input>
  105. </el-form-item>
  106. </div>
  107. <div style="width: 385px;">
  108. <el-form-item label="电话:" prop="tel" label-width="160px">
  109. <el-input clearable placeholder="电话" v-model="OpOfficialActivitiesDto.tel">
  110. </el-input>
  111. </el-form-item>
  112. </div>
  113. <div style="width: 385px;">
  114. <el-form-item label="公务形式:" prop="officialForm" label-width="160px">
  115. <el-select v-model="OpOfficialActivitiesDto.officialForm" clearable filterable placeholder="公务形式">
  116. <el-option v-for="item in OfficialFormList" :key="item.id" :label="item.name" :value="item.id">
  117. </el-option>
  118. </el-select>
  119. </el-form-item>
  120. </div>
  121. <!-- </div>
  122. <div style="display: flex;flex-wrap: wrap;"> -->
  123. <div style="width: 385px;">
  124. <el-form-item label="着装要求:" prop="dresscode" label-width="160px">
  125. <el-input clearable placeholder="着装要求" v-model="OpOfficialActivitiesDto.dresscode">
  126. </el-input>
  127. </el-form-item>
  128. </div>
  129. <div style="width: 385px;">
  130. <el-form-item label="涉及领域:" prop="field" label-width="160px">
  131. <el-input clearable placeholder="涉及领域" v-model="OpOfficialActivitiesDto.field">
  132. </el-input>
  133. </el-form-item>
  134. </div>
  135. <div style="width: 385px;">
  136. <el-form-item label="需要翻译:" prop="isNeedTrans" label-width="160px">
  137. <el-radio-group v-model="OpOfficialActivitiesDto.isNeedTrans">
  138. <el-radio :label=1>是</el-radio>
  139. <el-radio :label=0>否</el-radio>
  140. </el-radio-group>
  141. </el-form-item>
  142. </div>
  143. <div style="width: 385px;">
  144. <el-form-item label="翻译人员:" prop="translators" label-width="160px">
  145. <el-input clearable placeholder="翻译人员" v-model="OpOfficialActivitiesDto.translators">
  146. </el-input>
  147. </el-form-item>
  148. </div>
  149. <div style="width: 385px;">
  150. <el-form-item label="翻译语种:" prop="language" label-width="160px">
  151. <el-input clearable placeholder="翻译语种" v-model="OpOfficialActivitiesDto.language">
  152. </el-input>
  153. </el-form-item>
  154. </div>
  155. <div style="width: 385px;">
  156. <el-form-item label="是否付费:" prop="type" label-width="160px">
  157. <el-radio-group v-model="OpOfficialActivitiesDto.isPay">
  158. <el-radio :label=1>是</el-radio>
  159. <el-radio :label=0>否</el-radio>
  160. </el-radio-group>
  161. </el-form-item>
  162. </div>
  163. <div style="width: 385px;">
  164. <el-form-item label="是否报批:" prop="type" label-width="160px">
  165. <el-radio-group v-model="OpOfficialActivitiesDto.isSubmitApproval">
  166. <el-radio :label=1>是</el-radio>
  167. <el-radio :label=0>否</el-radio>
  168. </el-radio-group>
  169. </el-form-item>
  170. </div>
  171. </div>
  172. <div style="display: flex; flex-wrap: wrap;">
  173. <div style="width: 770px;">
  174. <el-form-item label="公务地址:" prop="address" label-width="160px">
  175. <el-input type="textarea" :rows="3" placeholder="公务地址"
  176. v-model="OpOfficialActivitiesDto.address"></el-input>
  177. </el-form-item>
  178. </div>
  179. <div style="width: 770px;">
  180. <el-form-item label="公务方背景:" prop="setting" label-width="160px">
  181. <el-input
  182. type="textarea"
  183. :rows="3"
  184. placeholder="公务方背景"
  185. v-model="OpOfficialActivitiesDto.setting">
  186. </el-input>
  187. </el-form-item>
  188. </div>
  189. <div style="width: 770px;">
  190. <el-form-item style="position: relative;" label="公务请示范例:" label-width="160px">
  191. <el-input @blur="reqSampleblur" @focus="PostOfficialActivitiesReqReqSampleTips" type="textarea" :rows="3" placeholder="公务请示范例" v-model="OpOfficialActivitiesDto.reqSample">
  192. </el-input>
  193. <div v-show="reqSampleArrpd" class="reqSampleArr-ul">
  194. <div @click="reqSampleArrli(item)" class="reqSampleArr-li" v-for="(item,index) in reqSampleArr" :key="index">
  195. {{'['+item.teamName+']('+item.client+') '+item.reqSample}}
  196. </div>
  197. </div>
  198. </el-form-item>
  199. </div>
  200. <!-- </div>
  201. <div style="display: flex;"> -->
  202. <div style="width: 770px;">
  203. <el-form-item label="暂定议程:" prop="trip" label-width="160px">
  204. <el-input type="textarea" :rows="3" placeholder="暂定议程"
  205. v-model="OpOfficialActivitiesDto.trip"></el-input>
  206. </el-form-item>
  207. </div>
  208. <div style="width:770px;">
  209. <el-form-item label="参会人员:" prop="attendees" label-width="160px">
  210. <el-input type="textarea" :rows="3" placeholder="参会人员"
  211. v-model="OpOfficialActivitiesDto.attendees"></el-input>
  212. </el-form-item>
  213. </div>
  214. <div style="width:770px;">
  215. <el-form-item label="邮件截图:" label-width="160px">
  216. <span style="display: inline-block;position: absolute;left: -82px;color: red;">*</span>
  217. <!-- <el-upload
  218. ref="Emailscreenshotref"
  219. :action="Emailscreenshoturl"
  220. :data="Emailscreenshotdata"
  221. :show-file-list="true"
  222. :auto-upload="false"
  223. :file-list="Emailscreenshot"
  224. :on-change="Emailscreenshotchange"
  225. :multiple="true"
  226. name="files">
  227. <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
  228. <el-button style="margin-left: 10px;" size="small" type="success"
  229. @click="UploadEmailscreenshot">上传</el-button>
  230. </el-upload> -->
  231. <el-upload
  232. accept="image/jpeg,image/png"
  233. class="pop-upload"
  234. ref="upload"
  235. action=""
  236. :file-list="fileList"
  237. :auto-upload="false"
  238. :multiple="true"
  239. :on-change="handleChange"
  240. :on-remove="handleRemove"
  241. :on-preview="handlePreview"
  242. :before-remove="beforeRemove"
  243. name="files"
  244. >
  245. <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
  246. <!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button> -->
  247. </el-upload>
  248. </el-form-item>
  249. </div>
  250. </div>
  251. <!-- <div>
  252. <div>
  253. <div class="communal-title">
  254. <div>公务文件</div>
  255. </div>
  256. </div>
  257. <span style="color: red;">上传、删除文件时请谨慎!!!</span>
  258. <hr style='background-color:#5555; height:1px; border:none;' />
  259. <div style="display: flex;">
  260. <div style="width: 33%;">
  261. 公务方简介:
  262. <el-upload :file-list="uploadFiles1" ref="upload1" :on-success="upLoadSuccess1" :on-error="upLoadError1"
  263. :before-remove="beforeRemove1" :on-change="onChange1" :limit="1" :on-exceed="exceed1"
  264. :action="uploadURL" :headers="headers1" :auto-upload="false" :on-preview="onPreview1">
  265. <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
  266. <el-button style="margin-left: 10px;" size="small" type="success"
  267. @click="submitUpload1">上传</el-button>
  268. </el-upload>
  269. </div>
  270. <div style="width: 33%;">
  271. 公务活动图片:
  272. <el-upload :file-list="uploadFiles2" ref="upload2" :on-success="upLoadSuccess2" :on-error="upLoadError2"
  273. :before-remove="beforeRemove2" :on-change="onChange2" :limit="1" :on-exceed="exceed2"
  274. :action="uploadURL" :headers="headers2" :auto-upload="false" :on-preview="onPreview2">
  275. <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
  276. <el-button style="margin-left: 10px;" size="small" type="success"
  277. @click="submitUpload2">上传</el-button>
  278. </el-upload>
  279. </div>
  280. <div style="width: 33%;">
  281. 发票:
  282. <el-upload :file-list="uploadFiles3" ref="upload3" :on-success="upLoadSuccess3" :on-error="upLoadError3"
  283. :before-remove="beforeRemove3" :on-change="onChange3" :limit="1" :on-exceed="exceed3"
  284. :action="uploadURL" :headers="headers3" :auto-upload="false" :on-preview="onPreview3">
  285. <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
  286. <el-button style="margin-left: 10px;" size="small" type="success"
  287. @click="submitUpload3">上传</el-button>
  288. </el-upload>
  289. </div>
  290. </div>
  291. </div> -->
  292. <el-form-item>
  293. <div style="text-align: right;">
  294. <el-button type="primary" @click="addBtn">保存</el-button>
  295. <el-button v-if="btnPermissions&&confirmTheInvitation==0" @click="OfficialActivitiesInviteOperation(1)" type="primary">复核确认</el-button>
  296. <el-button v-if="btnPermissions&&confirmTheInvitation==1" @click="OfficialActivitiesInviteOperation(0)" type="primary">取消确认</el-button>
  297. <el-button @click="returnbtn">取消</el-button>
  298. </div>
  299. </el-form-item>
  300. </el-form>
  301. </div>
  302. </div>
  303. </template>
  304. <script>
  305. export default {
  306. data() {
  307. return {
  308. confirmTheInvitation:0,
  309. title: "新增公务出访客户资料",
  310. token: '',
  311. userId: 0,
  312. id: '',
  313. DiId: '',
  314. isShow: false,
  315. delegationInfo: {},
  316. delegationInfoList: [],//团组下拉框
  317. OfficialFormList: [],//公务形式下拉框
  318. deleFile: [],//文件数据
  319. headers: {
  320. Authorization: JSON.parse(localStorage.getItem('userinif')).token,
  321. TypeName: "A"
  322. },
  323. OpOfficialActivitiesDto: {
  324. status: 0,
  325. id: 0,
  326. diId: "",
  327. type: "",
  328. client: "",
  329. date: "",
  330. time: "",
  331. address: "",
  332. contact: "",
  333. job: "",
  334. tel: "",
  335. officialForm: "",
  336. setting: "",
  337. dresscode: "",
  338. attendees: "",
  339. isNeedTrans: 0,
  340. translators: "",
  341. language: "",
  342. trip: "",
  343. createUserId: 0,
  344. isPay:0,
  345. isSubmitApproval:0,
  346. remark: "",
  347. country: "",
  348. area: "",
  349. field: "",
  350. reqSample: "",
  351. },
  352. reqSampleArr:[],
  353. reqSampleArrpd:false,
  354. OpOfficialActivitiesRules: {
  355. officialForm: [
  356. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  357. { required: true, message: '该信息为必填信息', trigger: 'change' },
  358. ],
  359. country: [
  360. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  361. ],
  362. area: [
  363. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  364. ],
  365. inviteCosts: [
  366. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  367. { required: true, message: '该信息为必填信息', trigger: 'change' },
  368. ],
  369. client: [
  370. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  371. { required: true, message: '该信息为必填信息', trigger: 'change' },
  372. ],
  373. date: [
  374. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  375. { required: true, message: '该信息为必填信息', trigger: 'change' },
  376. ],
  377. time: [
  378. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  379. { required: true, message: '该信息为必填信息', trigger: 'change' },
  380. ],
  381. address: [
  382. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  383. { required: true, message: '该信息为必填信息', trigger: 'change' },
  384. ],
  385. contact: [
  386. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  387. { required: true, message: '该信息为必填信息', trigger: 'change' },
  388. ],
  389. job: [
  390. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  391. { required: true, message: '该信息为必填信息', trigger: 'change' },
  392. ],
  393. tel: [
  394. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  395. { required: true, message: '该信息为必填信息', trigger: 'change' },
  396. ],
  397. dresscode: [
  398. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  399. { required: true, message: '该信息为必填信息', trigger: 'change' },
  400. ],
  401. field: [
  402. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  403. { required: true, message: '该信息为必填信息', trigger: 'change' },
  404. ],
  405. language: [
  406. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  407. { required: true, message: '该信息为必填信息', trigger: 'change' },
  408. ],
  409. setting: [
  410. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  411. { required: true, message: '该信息为必填信息', trigger: 'change' },
  412. ],
  413. type: [
  414. { required: true, message: '该信息为必填信息', trigger: 'blur' },
  415. { required: true, message: '该信息为必填信息', trigger: 'change' },
  416. ],
  417. fileList: [
  418. { required: true, message: '该信息为必填信息', trigger: 'change' },
  419. ],
  420. },
  421. uploadURL: "http://localhost:5256/api/Resource/UploadOfficialActivities",
  422. uploadFiles1: [],
  423. uploadFiles2: [],
  424. uploadFiles3: [],
  425. Emailscreenshot:[],
  426. Emailscreenshoturl:'http://132.232.92.186:8888/api/Resource/OfficialActivitiesUploadFiles',
  427. Emailscreenshotdata:{
  428. id:0,
  429. diId:0,
  430. currUserId:0,
  431. },
  432. Emailscreenshotheaders:{
  433. Authorization:"Content-Type:multipart/form-data"
  434. },
  435. headers1: {
  436. Authorization: JSON.parse(localStorage.getItem('userinif')).token,
  437. Type: "1",
  438. DiId: 0,
  439. CreateUserId: 0,
  440. },
  441. headers2: {
  442. Authorization: JSON.parse(localStorage.getItem('userinif')).token,
  443. Type: "2",
  444. DiId: 0,
  445. CreateUserId: 0,
  446. },
  447. headers3: {
  448. Authorization: JSON.parse(localStorage.getItem('userinif')).token,
  449. Type: "3",
  450. DiId: 0,
  451. CreateUserId: 0,
  452. },
  453. yqfarr:[],
  454. gwcfPermissions:[],
  455. btnPermissions:false,
  456. fileList:[],
  457. }
  458. },
  459. methods: {
  460. //日期处理(日)
  461. TimeProcessingri(val){
  462. let datetime=new Date(val)
  463. let newsyear=datetime.getFullYear();
  464. let newsMonth=datetime.getMonth() + 1<10?'0'+(datetime.getMonth() + 1):datetime.getMonth() + 1;
  465. let newsday=datetime.getDate()<10?'0'+datetime.getDate():datetime.getDate();
  466. return newsyear+ '-' +newsMonth+ '-' + newsday;
  467. },
  468. //团组下拉框
  469. GetGroupAllList() {
  470. var url = "/api/Resource/GetGroupAllList"
  471. var that = this
  472. this.$axios({
  473. method: 'post',
  474. url: url,
  475. headers: {
  476. Authorization: 'Bearer ' + this.token
  477. },
  478. data: {
  479. diid: that.DiId
  480. }
  481. }).then(function (res) {
  482. if (res.data.code == 200) {
  483. that.deleFile = res.data.data.deleFile;
  484. that.deleFile.forEach(function (item) {
  485. if (item.kind == 1) {
  486. that.uploadFiles1.push({
  487. name: item.fileName,
  488. url: 'http://localhost:5256/Office/GrpFile/商邀相关文件/',
  489. id: item.id
  490. });
  491. } else if (item.kind == 2) {
  492. that.uploadFiles2.push({
  493. name: item.fileName,
  494. url: 'http://localhost:5256/Office/GrpFile/商邀相关文件/',
  495. id: item.id
  496. });
  497. }
  498. else if (item.kind == 3) {
  499. that.uploadFiles3.push({
  500. name: item.fileName,
  501. url: 'http://localhost:5256/Office/GrpFile/商邀相关文件/',
  502. id: item.id
  503. });
  504. }
  505. });
  506. console.log(that.uploadFiles1)
  507. console.log(that.uploadFiles2)
  508. console.log(that.uploadFiles3)
  509. that.delegationInfoList = res.data.data.delegation;
  510. that.OfficialFormList = res.data.data.setData;
  511. if (that.OfficialFormList.length != 0) {
  512. if(that.id!=that.id){
  513. that.OpOfficialActivitiesDto.officialForm = that.OfficialFormList[0].id
  514. }
  515. }
  516. for (let index = 0; index < that.delegationInfoList.length; index++) {
  517. if (that.delegationInfoList[index].id == parseInt(that.DiId)) {
  518. that.delegationInfo = that.delegationInfoList[index];
  519. break;
  520. }
  521. }
  522. }
  523. }).catch(function (error) {
  524. // that.$message.error("网络错误,请稍后重试");
  525. });
  526. },
  527. //UploadEmailscreenshot
  528. UploadEmailscreenshot(){
  529. console.log(file, fileList);
  530. this.Emailscreenshotdata.diId=this.DiId;
  531. this.Emailscreenshotdata.currUserId=this.userId;
  532. this.submitUpload()
  533. },
  534. //获取邀请方
  535. QuerySetData(){
  536. var that = this;
  537. var url = "/api/System/QuerySetData"
  538. this.$axios({
  539. method: 'post',
  540. url: url,
  541. headers: {
  542. Authorization: 'Bearer ' + that.token
  543. },
  544. data: {
  545. dataType:85
  546. }
  547. }).then(function (res) {
  548. if (res.data.code == 200) {
  549. that.yqfarr=res.data.data;
  550. console.log(that.yqfarr);
  551. } else {
  552. that.$message.error(res.data.msg);
  553. }
  554. })
  555. },
  556. Emailscreenshotchange(file, fileList){
  557. console.log(file, fileList);
  558. },
  559. //获取公务请示范例提示
  560. PostOfficialActivitiesReqReqSampleTips(){
  561. var that = this;
  562. var url = "/api/Resource/PostOfficialActivitiesReqReqSampleTips"
  563. this.$axios({
  564. method: 'post',
  565. url: url,
  566. headers: {
  567. Authorization: 'Bearer ' + that.token
  568. },
  569. data: {
  570. country:that.OpOfficialActivitiesDto.country,
  571. area: that.OpOfficialActivitiesDto.area,
  572. client: that.OpOfficialActivitiesDto.client
  573. }
  574. }).then(function (res) {
  575. if (res.data.code == 200) {
  576. console.log(res)
  577. that.reqSampleArrpd=true
  578. that.reqSampleArr=res.data.data;
  579. // that.$message({
  580. // message: res.data.msg,
  581. // type: 'success'
  582. // });
  583. } else {
  584. that.$message.error(res.data.msg);
  585. }
  586. })
  587. },
  588. reqSampleblur(){
  589. // setTimeout(this.reqSampleArrpd=false,2000)
  590. setTimeout(() => {
  591. this.reqSampleArrpd=false
  592. }, 150);
  593. },
  594. DiIdChang() {
  595. for (let index = 0; index < this.delegationInfoList.length; index++) {
  596. if (this.delegationInfoList[index].id == parseInt(this.DiId)) {
  597. this.delegationInfo = this.delegationInfoList[index];
  598. break;
  599. }
  600. }
  601. },
  602. reqSampleArrli(val){
  603. console.log(val);
  604. this.OpOfficialActivitiesDto.reqSample=val.reqSample;
  605. this.reqSampleArrpd=false;
  606. },
  607. QueryOfficialActivitiesById() {
  608. var url = "/api/Resource/QueryOfficialActivitiesById"
  609. var that = this
  610. this.$axios({
  611. method: 'post',
  612. url: url,
  613. headers: {
  614. Authorization: 'Bearer ' + this.token
  615. },
  616. data: {
  617. Id: that.id,
  618. DiId: that.DiId,
  619. }
  620. }).then(function (res) {
  621. if (res.data.code == 200) {
  622. var dataList = res.data.data;
  623. that.OpOfficialActivitiesDto.id = dataList.id;
  624. that.OpOfficialActivitiesDto.diId = dataList.diId;
  625. that.OpOfficialActivitiesDto.type = dataList.type;
  626. that.OpOfficialActivitiesDto.client = dataList.client;
  627. that.OpOfficialActivitiesDto.date = dataList.date;
  628. that.OpOfficialActivitiesDto.time = dataList.time;;
  629. that.OpOfficialActivitiesDto.address = dataList.address;
  630. that.OpOfficialActivitiesDto.contact = dataList.contact;
  631. that.OpOfficialActivitiesDto.job = dataList.job;
  632. that.OpOfficialActivitiesDto.tel = dataList.tel;
  633. that.OpOfficialActivitiesDto.officialForm = dataList.officialForm;
  634. that.OpOfficialActivitiesDto.setting = dataList.setting;
  635. that.OpOfficialActivitiesDto.dresscode = dataList.dresscode;
  636. that.OpOfficialActivitiesDto.attendees = dataList.attendees;
  637. that.OpOfficialActivitiesDto.isNeedTrans = dataList.isNeedTrans;
  638. that.OpOfficialActivitiesDto.translators = dataList.translators;
  639. that.OpOfficialActivitiesDto.language = dataList.language;
  640. that.OpOfficialActivitiesDto.trip = dataList.trip;
  641. that.OpOfficialActivitiesDto.createUserId = dataList.createUserId;
  642. that.OpOfficialActivitiesDto.remark = dataList.remark;
  643. that.OpOfficialActivitiesDto.isSubmitApproval = dataList.isSubmitApproval;
  644. that.OpOfficialActivitiesDto.isPay = dataList.isPay;
  645. that.OpOfficialActivitiesDto.country = dataList.country;
  646. that.OpOfficialActivitiesDto.area = dataList.area;
  647. that.OpOfficialActivitiesDto.field = dataList.field;
  648. that.OpOfficialActivitiesDto.reqSample = dataList.reqSample;
  649. that.confirmTheInvitation=dataList.confirmTheInvitation
  650. // that.fileList
  651. that.fileList=[]
  652. for(let i=0;i<dataList.screenshotOfMailUrls.length;i++){
  653. that.fileList.push({'name':dataList.screenshotOfMailUrls[i].split('/')[7],'url':dataList.screenshotOfMailUrls[i]})
  654. }
  655. }
  656. })
  657. },
  658. addBtn() {
  659. if (this.DiId == null && this.DiId == undefined && this.DiId == "") {
  660. this.$message.error("请选择团组名称");
  661. return;
  662. }
  663. if(this.fileList.length<=0){
  664. this.$message.error("请先选取邮件截图");
  665. return;
  666. }
  667. this.submitUpload();
  668. const that = this;
  669. this.OpOfficialActivitiesDto.date=this.TimeProcessingri(this.OpOfficialActivitiesDto.date)
  670. that.OpOfficialActivitiesDto.createUserId = that.userId
  671. that.OpOfficialActivitiesDto.diId = that.DiId
  672. that.$refs.OpOfficialActivitiesDto.validate((valid) => {
  673. if (valid) {
  674. var url = "/api/Resource/OpOfficialActivities"
  675. that.$axios({
  676. method: 'post',
  677. url: url,
  678. headers: {
  679. Authorization: 'Bearer ' + that.token
  680. },
  681. data: that.OpOfficialActivitiesDto
  682. }).then(function (res) {
  683. if (res.data.code == 200) {
  684. that.$message({
  685. message: res.data.msg,
  686. type: 'success'
  687. });
  688. that.returnbtn();
  689. that.loading = true;
  690. } else {
  691. that.$message.error(res.data.msg);
  692. }
  693. })
  694. } else {
  695. this.$message.error('请完善信息在保存!');
  696. return false;
  697. }
  698. })
  699. },
  700. //上传1
  701. //上传到服务器
  702. submitUpload1() {
  703. this.$refs.upload1.submit();
  704. },
  705. // 文件超出限制
  706. exceed1(files, fileList) {
  707. this.$message.warning(
  708. `当前限制选择 1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length
  709. } 个文件,请取消要替换的文件`
  710. );
  711. },
  712. //文件上传成功时的钩子
  713. upLoadSuccess1(response, file, fileList) {
  714. this.$message({
  715. message: response.msg,
  716. type: 'success'
  717. });
  718. },
  719. //文件上传失败时的钩子
  720. upLoadError1(response, file, fileList) {
  721. console.log("项目添加失败");
  722. },
  723. //取消文件时的钩子
  724. beforeRemove1(file, fileList) {
  725. const that = this;
  726. var url = "/api/Resource/DelloadOfficialActivities"
  727. this.$axios({
  728. method: 'post',
  729. url: url,
  730. headers: {
  731. Authorization: 'Bearer ' + that.token
  732. },
  733. data: {
  734. Id: file.id,
  735. DeleteUserId: that.userId
  736. }
  737. }).then(function (res) {
  738. if (res.data.code == 200) {
  739. that.$message({
  740. message: res.data.msg,
  741. type: 'success'
  742. });
  743. } else {
  744. that.$message.error(res.data.msg);
  745. }
  746. })
  747. },
  748. //文件状态改变时的钩子
  749. onChange1(file, fileList) {
  750. },
  751. //点击文件的钩子
  752. onPreview1(file) {
  753. window.location.href = "http://132.232.92.186:24/Office/GrpFile/商邀相关文件/" + file.name
  754. },
  755. //上传2
  756. //上传到服务器
  757. submitUpload2() {
  758. this.$refs.upload2.submit();
  759. },
  760. // 文件超出限制
  761. exceed2(files, fileList) {
  762. this.$message.warning(
  763. `当前限制选择 1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length
  764. } 个文件,请取消要替换的文件`
  765. );
  766. },
  767. //文件上传成功时的钩子
  768. upLoadSuccess2(response, file, fileList) {
  769. this.$message({
  770. message: response.msg,
  771. type: 'success'
  772. });
  773. },
  774. //文件上传失败时的钩子
  775. upLoadError2(response, file, fileList) {
  776. console.log("项目添加失败");
  777. },
  778. //删除文件时出发的事件
  779. beforeRemove2(file, fileList) {
  780. const that = this;
  781. var url = "/api/Resource/DelloadOfficialActivities"
  782. this.$axios({
  783. method: 'post',
  784. url: url,
  785. headers: {
  786. Authorization: 'Bearer ' + that.token
  787. },
  788. data: {
  789. Id: file.id,
  790. DeleteUserId: that.userId
  791. }
  792. }).then(function (res) {
  793. if (res.data.code == 200) {
  794. that.$message({
  795. message: res.data.msg,
  796. type: 'success'
  797. });
  798. } else {
  799. that.$message.error(res.data.msg);
  800. }
  801. })
  802. },
  803. //文件状态改变时的钩子
  804. onChange2(file, fileList) {
  805. },
  806. //点击文件的钩子
  807. onPreview2(file) {
  808. window.location.href = "http://132.232.92.186:24/Office/GrpFile/商邀相关文件/" + file.name
  809. },
  810. //上传3
  811. //上传到服务器
  812. submitUpload3() {
  813. this.$refs.upload3.submit();
  814. },
  815. // 文件超出限制
  816. exceed3(files, fileList) {
  817. this.$message.warning(
  818. `当前限制选择 1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length
  819. } 个文件,请取消要替换的文件`
  820. );
  821. },
  822. //文件上传成功时的钩子
  823. upLoadSuccess3(response, file, fileList) {
  824. this.$message({
  825. message: response.msg,
  826. type: 'success'
  827. });
  828. },
  829. //文件上传失败时的钩子
  830. upLoadError3(response, file, fileList) {
  831. console.log("项目添加失败");
  832. },
  833. //删除文件时出发的事件
  834. beforeRemove3(file, fileList) {
  835. const that = this;
  836. var url = "/api/Resource/DelloadOfficialActivities"
  837. this.$axios({
  838. method: 'post',
  839. url: url,
  840. headers: {
  841. Authorization: 'Bearer ' + that.token
  842. },
  843. data: {
  844. Id: file.id,
  845. DeleteUserId: that.userId
  846. }
  847. }).then(function (res) {
  848. if (res.data.code == 200) {
  849. that.$message({
  850. message: res.data.msg,
  851. type: 'success'
  852. });
  853. setTimeout(() => {
  854. that.$router.push('/home/OfficialActivities')
  855. }, 3000);
  856. } else {
  857. that.$message.error(res.data.msg);
  858. }
  859. })
  860. },
  861. //文件状态改变时的钩子
  862. onChange3(file, fileList) {
  863. },
  864. //点击文件的钩子
  865. onPreview3(file) {
  866. let href = "http://132.232.92.186:24/Office/GrpFile/商邀相关文件/" + file.name
  867. var a = document.createElement("a");
  868. a.href = href;
  869. a.download = file.name;
  870. a.style.display = "none";
  871. document.body.appendChild(a);
  872. a.click();
  873. a.remove();
  874. //window.location.href = "http://132.232.92.186:24/Office/GrpFile/商邀相关文件/" + file.name
  875. },
  876. //返回
  877. returnbtn(){
  878. this.$router.push({
  879. path: "/home/OfficialActivities",
  880. query: {
  881. DiId: this.DiId,
  882. }
  883. })
  884. },
  885. // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用,function(file, fileList)
  886. handleChange(file, fileList) {
  887. console.log(file);
  888. console.log(fileList);
  889. this.fileList = fileList
  890. },
  891. //删除文件
  892. beforeRemove(file,fileList){
  893. if(file && file.status=="success"){
  894. return this.$confirm('此文件已上传至服务器此操作将永久删除该文件, 是否继续?', '提示', {
  895. confirmButtonText: '确定',
  896. cancelButtonText: '取消',
  897. type: 'warning'
  898. }).then(() => {
  899. // this.$message({
  900. // type: 'success',
  901. // message: '删除成功!'
  902. // });
  903. }).catch(() => {
  904. this.$message({
  905. type: 'info',
  906. message: '已取消删除'
  907. });
  908. reject(false)
  909. });
  910. }
  911. },
  912. // 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。function(file, fileList)
  913. handleRemove(file, fileList) {
  914. this.fileList = fileList
  915. if (file && file.status=="success") {
  916. var that = this;
  917. var url = "/api/Resource/OfficialActivitiesDelFile"
  918. this.$axios({
  919. method: 'post',
  920. url: url,
  921. headers: {
  922. Authorization: 'Bearer ' + that.token
  923. },
  924. data:{
  925. id:that.id,
  926. fileName:file.name
  927. }
  928. }).then(function (res) {
  929. if (res.data.code == 200) {
  930. that.$message.success(res.data.msg);
  931. } else {
  932. that.$message.error(res.data.msg);
  933. }
  934. })
  935. }
  936. },
  937. //点击文件列表中已上传的文件
  938. handlePreview(file){
  939. console.log(file);
  940. window.open(file.url);
  941. },
  942. //上传服务器
  943. submitUpload() {
  944. // console.log(this.id);
  945. var verdict=false
  946. if(this.id==undefined){
  947. this.id==0
  948. }
  949. this.Emailscreenshotdata.id=this.id;
  950. this.Emailscreenshotdata.diId=this.DiId;
  951. this.Emailscreenshotdata.currUserId=this.userId;
  952. //判断是否有文件再上传
  953. if (this.fileList.length === 0) {
  954. return this.$message.warning('请选取文件后再上传');
  955. }
  956. // 下面的代码将创建一个空的FormData对象:
  957. const formData = new FormData()
  958. // 你可以使用FormData.append来添加键/值对到表单里面;
  959. this.fileList.forEach((file) => {
  960. if(file.raw!=undefined){
  961. verdict=true;
  962. formData.append('files', file.raw);
  963. }
  964. })
  965. formData.append('id', this.Emailscreenshotdata.id);
  966. formData.append('diId', this.Emailscreenshotdata.diId);
  967. formData.append('currUserId', this.Emailscreenshotdata.currUserId);
  968. if(!verdict){
  969. return
  970. }
  971. var that = this;
  972. var url = "/api/Resource/OfficialActivitiesUploadFiles"
  973. this.$axios({
  974. method: 'post',
  975. url: url,
  976. headers: {
  977. Authorization: 'Bearer ' + that.token
  978. },
  979. data:formData
  980. }).then(function (res) {
  981. if (res.data.code == 200) {
  982. that.$message.success(res.data.msg);
  983. that.fileList = []
  984. for(let i=0;i<res.data.data.fileUrls.length;i++){
  985. that.fileList.push({'name':res.data.data.fileUrls[i].split('/')[7],'url':res.data.data.fileUrls[i]})
  986. }
  987. } else {
  988. that.$message.error(res.data.msg);
  989. }
  990. })
  991. },
  992. //确认邀请
  993. OfficialActivitiesInviteOperation(val){
  994. var that = this;
  995. var url = "/api/Resource/OfficialActivitiesInviteOperation"
  996. this.$axios({
  997. method: 'post',
  998. url: url,
  999. headers: {
  1000. Authorization: 'Bearer ' + that.token
  1001. },
  1002. data:{
  1003. id:that.id,
  1004. type:val
  1005. }
  1006. }).then(function (res) {
  1007. if (res.data.code == 200) {
  1008. that.QueryOfficialActivitiesById()
  1009. that.$message.success(res.data.msg);
  1010. } else {
  1011. that.$message.error(res.data.msg);
  1012. }
  1013. })
  1014. }
  1015. },
  1016. mounted() {
  1017. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  1018. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  1019. this.gwcfPermissions=JSON.parse(localStorage.getItem('Permissions'));
  1020. this.DiId = parseInt(this.$route.query.DiId)
  1021. console.log(this.gwcfPermissions);
  1022. for(let k=0;k<this.gwcfPermissions.length;k++){
  1023. if(this.gwcfPermissions[k].funid==12){
  1024. this.btnPermissions=true;
  1025. }
  1026. }
  1027. this.QuerySetData();
  1028. this.id = this.$route.query.id
  1029. this.headers1.DiId = this.DiId
  1030. this.headers1.CreateUserId = this.userId
  1031. this.headers2.DiId = this.DiId
  1032. this.headers2.CreateUserId = this.userId
  1033. this.headers3.DiId = this.DiId
  1034. this.headers3.CreateUserId = this.userId
  1035. this.GetGroupAllList();
  1036. if (this.DiId == null && this.DiId == undefined && this.DiId == 0) {
  1037. this.DiId = '';
  1038. }
  1039. if (this.id != null && this.id != undefined && this.id != 0) {
  1040. this.QueryOfficialActivitiesById();
  1041. this.title = "修改公务出访客户资料";
  1042. this.OpOfficialActivitiesDto.status = 2
  1043. this.isShow = true
  1044. } else {
  1045. this.OpOfficialActivitiesDto.status = 1
  1046. this.title = "新增公务出访客户资料"
  1047. this.isShow = false
  1048. }
  1049. }
  1050. }
  1051. </script>
  1052. <style>
  1053. .car_add .communal-title {
  1054. display: flex;
  1055. font-size: 17px;
  1056. font-weight: 600;
  1057. color: #555;
  1058. margin-bottom: 20px;
  1059. justify-content: space-between;
  1060. align-items: center;
  1061. }
  1062. .appraise-box {
  1063. display: flex;
  1064. flex-wrap: wrap;
  1065. justify-content: space-between;
  1066. margin: 50px 0;
  1067. }
  1068. .appraise-box>div {
  1069. width: 30%;
  1070. }
  1071. .communal-box {
  1072. display: flex;
  1073. }
  1074. .communal-box>button {
  1075. margin-left: 10px;
  1076. padding: 8px 20px;
  1077. }
  1078. .car_add {
  1079. background-color: #fff;
  1080. padding: 20px;
  1081. box-shadow: 0 0 5px #0005;
  1082. border-radius: 10px;
  1083. min-height: 810px;
  1084. }
  1085. .visit-box .el-date-editor.el-input, .el-date-editor.el-input__inner{
  1086. width: 100%;
  1087. }
  1088. .visit-box .el-select{
  1089. width: 100%;
  1090. }
  1091. .reqSampleArr-ul{
  1092. position:absolute;
  1093. z-index:1;
  1094. background-color: #FFFFFF;
  1095. box-shadow: #5555 0 0 10px;
  1096. border-radius:5px ;
  1097. max-height: 400px;
  1098. overflow: auto;
  1099. }
  1100. .reqSampleArr-li:hover{
  1101. background-color: #5551;
  1102. }
  1103. .reqSampleArr-li{
  1104. line-height: 20px;
  1105. padding: 10px;
  1106. cursor: pointer;
  1107. }
  1108. .ps-title{
  1109. color: red;
  1110. font-size: 12px;
  1111. }
  1112. @media screen and (max-width: 1700px) {
  1113. .appraise-box>div {
  1114. width: 48%;
  1115. }
  1116. .appraise-box>div el-form-item__content {
  1117. width: 260px !important;
  1118. }
  1119. }
  1120. </style>