OpVisaPriec.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. <template>
  2. <div class="car_add">
  3. <div>
  4. <div class="communal-title">
  5. <div>{{ title }}</div>
  6. </div>
  7. </div>
  8. <hr style='background-color:#5555; height:1px; border:none;' />
  9. <div>
  10. <el-form :model="delegationInfo" label-width="100px" class="demo-ruleForm">
  11. <div style="display: flex;">
  12. <div style="width: 25%;">
  13. <el-form-item label="团组名称:" label-width="160px">
  14. <el-select v-model="OpVisaPriceData.diId" clearable filterable placeholder="团组选择"
  15. :disabled="isShow" style="width: 100%;" @change="DiIdSelectChange">
  16. <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
  17. :value="item.id">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. </div>
  22. <div style="width: 25%;">
  23. <el-form-item label="团 号:" prop="tourCode" label-width="160px">
  24. <el-input placeholder="团号" v-model="delegationInfo.tourCode" :disabled="true">
  25. </el-input>
  26. </el-form-item>
  27. </div>
  28. <div style="width: 25%;">
  29. <el-form-item label="客户:" prop="clientName" label-width="160px">
  30. <el-input placeholder="客户" v-model="delegationInfo.clientName" :disabled="true">
  31. </el-input>
  32. </el-form-item>
  33. </div>
  34. <div style="width: 25%;">
  35. <el-form-item label="出访国家:" prop="visitCountry" label-width="160px">
  36. <el-input placeholder="出访国家" v-model="delegationInfo.visitCountry" :disabled="true">
  37. </el-input>
  38. </el-form-item>
  39. </div>
  40. </div>
  41. <div style="display: flex;">
  42. <div style="width: 25%;">
  43. <el-form-item label="出访时间:" label-width="160px">
  44. <el-input placeholder="出访时间" v-model="VisitDate" :disabled="true">
  45. </el-input>
  46. </el-form-item>
  47. </div>
  48. <div style="width: 25%;">
  49. <el-form-item label="出访人数:" label-width="160px">
  50. <el-input placeholder="出访人数" v-model="delegationInfo.visitPNumber" :disabled="true">
  51. </el-input>
  52. </el-form-item>
  53. </div>
  54. <div style="width: 25%;">
  55. <el-form-item label="出访天数:" label-width="160px">
  56. <el-input placeholder="出访天数" v-model="delegationInfo.visitDays" :disabled="true">
  57. </el-input>
  58. </el-form-item>
  59. </div>
  60. </div>
  61. </el-form>
  62. <el-form :model="OpVisaPriceData" ref="OpVisaPriceData" :rules="OpVisaPriceDataRules" label-width="100px"
  63. class="demo-ruleForm">
  64. <div style="width: 100%;">
  65. <el-form-item label="此舱位客人名称:" prop="visaClient" label-width="160px">
  66. <el-select @change="clientNamechange" style="width: 100%;" v-model="OpVisaPriceData.visaClient"
  67. placeholder="此舱位客人名称" multiple clearable filterable>
  68. <el-option v-for="item in fliterClient" :key="item.id"
  69. :label="item.lastName + item.firstName" :value="item.id">
  70. </el-option>
  71. </el-select>
  72. </el-form-item>
  73. </div>
  74. <div style="display: flex;flex-wrap: wrap;">
  75. <!-- <div style="width: 25%;">
  76. <el-form-item label="签证客户:" prop="visaClient" label-width="160px">
  77. <el-input placeholder="签证客户" v-model="OpVisaPriceData.visaClient">
  78. </el-input>
  79. </el-form-item>
  80. </div> -->
  81. <div style="width: 25%;">
  82. <el-form-item label="签证费用:" prop="visaPrice" label-width="160px">
  83. <el-input placeholder="签证费用" v-model="OpVisaPriceData.visaPrice" style="width: 58%;">
  84. </el-input>
  85. <el-select v-model="OpVisaPriceData.visaCurrency" filterable placeholder="币种"
  86. style="width: 35%;">
  87. <el-option v-for="item in rateList" :key="item.currencyId" :label="item.currencyCode"
  88. :value="item.currencyId"></el-option>
  89. </el-select>
  90. </el-form-item>
  91. </div>
  92. <div style="width: 25%;">
  93. <el-form-item label="是否第三方代办:" prop="isThird" label-width="160px">
  94. <el-radio-group v-model="OpVisaPriceData.isThird">
  95. <el-radio :label=1>是</el-radio>
  96. <el-radio :label=0>否</el-radio>
  97. </el-radio-group>
  98. </el-form-item>
  99. </div>
  100. <div style="width: 25%;">
  101. <el-form-item label="客户类型:" prop="passengerType" label-width="160px">
  102. <el-select v-model="OpVisaPriceData.passengerType" clearable filterable placeholder="客户类型">
  103. <el-option v-for="item in passengerTypeSelect" :key="item.id" :label="item.name"
  104. :value="item.id">
  105. </el-option>
  106. </el-select>
  107. </el-form-item>
  108. </div>
  109. <div style="width: 25%;">
  110. <el-form-item label="签证办理人数:" prop="visaNumber" label-width="160px">
  111. <el-input placeholder="签证办理人数" v-model="OpVisaPriceData.visaNumber" style="width: 100%;">
  112. </el-input>
  113. </el-form-item>
  114. </div>
  115. <div style="width: 25%;">
  116. <el-form-item label="免签人数:" prop="visaFreeNumber" label-width="160px">
  117. <el-input placeholder="免签人数" v-model="OpVisaPriceData.visaFreeNumber" style="width: 100%;">
  118. </el-input>
  119. </el-form-item>
  120. </div>
  121. </div>
  122. <div style="display: flex;">
  123. <div style="width: 100%;">
  124. <el-form-item label="备 注:" prop="Remark" label-width="160px">
  125. <el-input type="textarea" :rows="5" placeholder="备注"
  126. v-model="OpVisaPriceData.remark"></el-input>
  127. </el-form-item>
  128. </div>
  129. </div>
  130. <hr style='background-color:#5555; height:1px; border:none;margin-top: 10px;' />
  131. <div style="display: flex;">
  132. <div style="width: 25%;">
  133. <el-form-item label="支付方式:" prop="payDId" label-width="160px">
  134. <el-select v-model="OpVisaPriceData.payDId" placeholder="支付方式" style="width: 100%;"
  135. @change="payChange">
  136. <el-option v-for="item in payment" :key="item.id" :label="item.name" :value="item.id">
  137. </el-option>
  138. </el-select>
  139. </el-form-item>
  140. </div>
  141. <div style="width: 25%;">
  142. <el-form-item label="消费方式:" prop="consumptionPatterns" label-width="160px">
  143. <el-input placeholder="消费方式" v-model="OpVisaPriceData.consumptionPatterns">
  144. </el-input>
  145. </el-form-item>
  146. </div>
  147. <div style="width: 25%;">
  148. <el-form-item label="消费日期:" prop="consumptionDate" label-width="160px">
  149. <el-date-picker style="width:100%" v-model="OpVisaPriceData.consumptionDate"
  150. placeholder="消费日期" type="date">
  151. </el-date-picker>
  152. </el-form-item>
  153. </div>
  154. <div style="width: 25%;">
  155. <el-form-item label="付款金额:" prop="payMoney" label-width="160px">
  156. <el-input placeholder="付款金额" v-model="OpVisaPriceData.visaPrice" style="width: 52%;"
  157. :disabled="true">
  158. </el-input>
  159. <el-select v-model="OpVisaPriceData.visaCurrency" style="width: 45%;" :disabled="true">
  160. <el-option v-for="item in rateList" :key="item.currencyId" :label="item.currencyCode"
  161. :value="item.currencyId"></el-option>
  162. </el-select>
  163. </el-form-item>
  164. </div>
  165. </div>
  166. <div v-if="OpVisaPriceData.payDId == 72">
  167. <div style="display: flex;">
  168. <div style="width: 25%;">
  169. <el-form-item label="卡类型:" prop="ctdId" label-width="160px">
  170. <el-select v-model="OpVisaPriceData.ctdId" placeholder="卡类型" style="width: 100%;"
  171. @change="ctdChange">
  172. <el-option v-for="item in bankCard" :key="item.id" :label="item.name"
  173. :value="item.id">
  174. </el-option>
  175. </el-select>
  176. </el-form-item>
  177. </div>
  178. <div style="width: 25%;">
  179. <el-form-item label="银行卡号:" prop="bankNo" label-width="160px">
  180. <el-input placeholder="银行卡号" v-model="OpVisaPriceData.bankNo" :disabled="true">
  181. </el-input>
  182. </el-form-item>
  183. </div>
  184. <div style="width: 25%;">
  185. <el-form-item label="持卡人姓名:" prop="cardholderName" label-width="160px">
  186. <el-input placeholder="持卡人姓名" v-model="OpVisaPriceData.cardholderName" :disabled="true">
  187. </el-input>
  188. </el-form-item>
  189. </div>
  190. </div>
  191. </div>
  192. <div v-else-if="OpVisaPriceData.payDId == 73">
  193. <div style="display: flex;">
  194. <div style="width: 25%;">
  195. <el-form-item label="公司银行账号:" label-width="160px" prop="companyBankNo">
  196. <el-input placeholder="公司银行账号" v-model="OpVisaPriceData.companyBankNo">
  197. </el-input>
  198. </el-form-item>
  199. </div>
  200. <div style="width: 25%;">
  201. <el-form-item label="对方开户行:" prop="otherBankName" label-width="160px">
  202. <el-input placeholder="对方开户行:" v-model="OpVisaPriceData.otherBankName">
  203. </el-input>
  204. </el-form-item>
  205. </div>
  206. <div style="width: 25%;">
  207. <el-form-item label="对方银行卡号:" prop="otherSideNo" label-width="160px">
  208. <el-input placeholder="对方银行卡号" v-model="OpVisaPriceData.otherSideNo">
  209. </el-input>
  210. </el-form-item>
  211. </div>
  212. <div style="width: 25%;">
  213. <el-form-item label="对方姓名:" prop="otherSideName" label-width="160px">
  214. <el-input placeholder="对方姓名" v-model="OpVisaPriceData.otherSideName">
  215. </el-input>
  216. </el-form-item>
  217. </div>
  218. </div>
  219. </div>
  220. <div v-else-if="OpVisaPriceData.payDId == 83">
  221. <div style="display: flex;">
  222. <div style="width: 25%;">
  223. <el-form-item label="对方开户行:" prop="otherBankName" label-width="160px">
  224. <el-input placeholder="对方开户行" v-model="OpVisaPriceData.otherBankName">
  225. </el-input>
  226. </el-form-item>
  227. </div>
  228. <div style="width: 25%;">
  229. <el-form-item label="对方银行卡号:" prop="otherSideNo" label-width="160px">
  230. <el-input placeholder="对方银行卡号" v-model="OpVisaPriceData.otherSideNo">
  231. </el-input>
  232. </el-form-item>
  233. </div>
  234. <div style="width: 25%;">
  235. <el-form-item label="对方姓名:" prop="otherSideName" label-width="160px">
  236. <el-input placeholder="对方姓名" v-model="OpVisaPriceData.otherSideName">
  237. </el-input>
  238. </el-form-item>
  239. </div>
  240. </div>
  241. </div>
  242. <div v-else></div>
  243. <div style="display:flex;">
  244. <div style="width: 25%;">
  245. <el-form-item label="收款方:" prop="payee" label-width="160px">
  246. <el-input placeholder="对方姓名:" v-model="OpVisaPriceData.payee">
  247. </el-input>
  248. </el-form-item>
  249. </div>
  250. <div style="width: 25%;">
  251. <el-form-item label="费用标识:" prop="orbitalPrivateTransfer" label-width="160px">
  252. <el-select v-model="OpVisaPriceData.orbitalPrivateTransfer" placeholder="费用标识"
  253. style="width: 100%;">
  254. <el-option key="0" label="公转" :value=0>
  255. </el-option>
  256. <el-option key="1" label="私转" :value=1>
  257. </el-option>
  258. </el-select>
  259. </el-form-item>
  260. </div>
  261. </div>
  262. <div style="display: flex;">
  263. <div style="width: 100%;">
  264. <el-form-item label="备 注:" prop="Remark" label-width="160px">
  265. <el-input type="textarea" :rows="5" placeholder="备注"
  266. v-model="OpVisaPriceData.cRemark"></el-input>
  267. </el-form-item>
  268. </div>
  269. </div>
  270. <el-form-item>
  271. <div style="text-align: right;">
  272. <el-button type="primary" @click="addBtn">保存</el-button>
  273. <el-button @click="EscAdd">取消</el-button>
  274. </div>
  275. </el-form-item>
  276. </el-form>
  277. </div>
  278. </div>
  279. </template>
  280. <script>
  281. import { dE } from '@fullcalendar/core/internal-common';
  282. export default {
  283. data() {
  284. return {
  285. title: "新增商邀费用",
  286. token: '',
  287. userId: 0,
  288. id: '',
  289. isShow: false,
  290. delegationInfo: {},
  291. delegationInfoList: [],//团组下拉框
  292. currencyList: [],//币种下拉框
  293. bankCard: [],//卡类型下拉框
  294. payment: [],//支付方式下拉框
  295. OpVisaPriceData: {
  296. status: 0,
  297. id: 0,
  298. diId: '',
  299. visaClient: '',
  300. visaPrice: 0,
  301. visaCurrency: '',
  302. isThird: '',
  303. passengerType: '',
  304. visaNumber: 0,
  305. visaFreeNumber: 0,
  306. createUserId: 0,
  307. remark: '',
  308. payDId: 72,
  309. consumptionPatterns: '',
  310. consumptionDate: '',
  311. ctdId: '',
  312. companyBankNo: '',
  313. otherBankName: '',
  314. otherSideNo: '',
  315. otherSideName: '',
  316. bankNo: '',
  317. cardholderName: '',
  318. payee: '',
  319. orbitalPrivateTransfer: 0,
  320. cRemark: '',
  321. },
  322. IsAuditGM: 0,
  323. VisitDate: '',
  324. passengerTypeSelect: [],
  325. fliterClient: [],
  326. transformDateFormat: function (value) {
  327. // 将value转换为Date对象
  328. var date = new Date(value);
  329. // 获取年、月、日
  330. var year = date.getFullYear();
  331. var month = date.getMonth() + 1;
  332. var day = date.getDate();
  333. // 将月份和日期转换为两位数的格式
  334. if (month < 10) {
  335. month = '0' + month;
  336. }
  337. if (day < 10) {
  338. day = '0' + day;
  339. }
  340. // 返回格式化后的日期字符串
  341. return year + '-' + month + '-' + day;
  342. },
  343. OpVisaPriceDataRules: {
  344. visaPrice: [
  345. { required: true, message: '请输入费用金额', trigger: ['blur', 'change'] },
  346. { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
  347. ],
  348. visaClient: [
  349. { required: true, message: '请输入费用名称', trigger: ['blur'] },
  350. ],
  351. isThird: [
  352. { required: true, message: '请选择是否第三方代办', trigger: ['blur', 'change'] },
  353. ],
  354. passengerType: [
  355. { required: true, message: '请选择客户类型', trigger: ['blur', 'change'] },
  356. ],
  357. visaNumber: [
  358. { required: true, message: '请输入办理人数', trigger: ['blur', 'change'] },
  359. { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
  360. ],
  361. visaFreeNumber: [
  362. { required: true, message: '请输入办理人数', trigger: ['blur', 'change'] },
  363. { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
  364. ],
  365. payDId: [
  366. { required: true, message: '请选择支付方式', trigger: ['blur', 'change'] },
  367. ],
  368. consumptionPatterns: [
  369. { required: true, message: '请输入消费方式', trigger: ['blur', 'change'] },
  370. ],
  371. consumptionDate: [
  372. { required: true, message: '请选择消费日期', trigger: ['blur', 'change'] },
  373. ],
  374. payee: [
  375. { required: true, message: '请输入收款方', trigger: ['blur', 'change'] },
  376. ],
  377. ctdId: [
  378. { required: true, message: '请选择卡类型', trigger: ['blur', 'change'] },
  379. ],
  380. companyBankNo: [{ required: true, message: '公司银行账号', trigger: ['blur', 'change'] },],
  381. otherBankName: [{ required: true, message: '对方开户行', trigger: ['blur', 'change'] },],
  382. otherSideNo: [{ required: true, message: '对方银行卡号', trigger: ['blur', 'change'] },],
  383. totherSideName: [{ required: true, message: '对方姓名', trigger: ['blur', 'change'] },],
  384. },
  385. rateList: [],
  386. }
  387. },
  388. methods: {
  389. //初始化下拉框
  390. initializeSelect() {
  391. //团组下拉框绑定
  392. var url = "/api/Groups/DecreasePaymentsSelect"
  393. var that = this
  394. this.$axios({
  395. method: 'post',
  396. url: url,
  397. headers: {
  398. Authorization: 'Bearer ' + this.token
  399. },
  400. data: {
  401. userId: that.userId,
  402. ctId: 80
  403. }
  404. }).then(function (res) {
  405. if (res.data.code == 200) {
  406. that.delegationInfoList = res.data.data.groupName;
  407. that.payment = res.data.data.payment
  408. for (let index = 0; index < that.delegationInfoList.length; index++) {
  409. if (that.delegationInfoList[index].id == that.OpVisaPriceData.diId) {
  410. that.delegationInfo = that.delegationInfoList[index];
  411. that.VisitDate = that.transformDateFormat(that.delegationInfo.visitStartDate) + '至' + that.transformDateFormat(that.delegationInfo.visitEndDate);
  412. break;
  413. }
  414. }
  415. }
  416. })
  417. var url = "/api/Groups/VisaPriceAddSelect"
  418. this.$axios({
  419. method: 'post',
  420. url: url,
  421. headers: {
  422. Authorization: 'Bearer ' + this.token
  423. },
  424. }).then(function (res) {
  425. if (res.data.code == 200) {
  426. that.bankCard = res.data.data.bankCard;
  427. that.payment = res.data.data.payment;
  428. that.currencyList = res.data.data.currencyList;
  429. that.passengerTypeSelect = res.data.data.passengerType;
  430. }
  431. })
  432. },
  433. DiIdSelectChange() {
  434. var that = this;
  435. this.QueryRate();
  436. for (let index = 0; index < that.delegationInfoList.length; index++) {
  437. if (that.delegationInfoList[index].id == that.OpVisaPriceData.diId) {
  438. that.delegationInfo = that.delegationInfoList[index];
  439. that.VisitDate = that.transformDateFormat(that.delegationInfo.visitStartDate) + '至' + that.transformDateFormat(that.delegationInfo.visitEndDate);
  440. that.QueryClientInfoByDIID()
  441. break;
  442. }
  443. }
  444. },
  445. payChange() {
  446. this.OpVisaPriceData.ctdId = '';
  447. this.OpVisaPriceData.bankNo = '';
  448. this.OpVisaPriceData.cardholderName = '';
  449. this.OpVisaPriceData.companyBankNo = '';
  450. this.OpVisaPriceData.otherBankName = '';
  451. this.OpVisaPriceData.otherSideNo = '';
  452. this.OpVisaPriceData.otherSideName = '';
  453. this.OpVisaPriceData.cRemark = '';
  454. if (this.OpVisaPriceData.payDId == 73) {
  455. this.OpVisaPriceDataRules.companyBankNo = [{ required: true, message: '公司银行账号', trigger: ['blur', 'change'] },]
  456. this.OpVisaPriceDataRules.otherBankName = [{ required: true, message: '对方开户行', trigger: ['blur', 'change'] },]
  457. this.OpVisaPriceDataRules.otherSideNo = [{ required: true, message: '对方银行卡号', trigger: ['blur', 'change'] },]
  458. this.OpVisaPriceDataRules.otherSideName = [{ required: true, message: '对方姓名', trigger: ['blur', 'change'] },]
  459. this.OpVisaPriceDataRules.ctdId = []
  460. } else if (this.OpVisaPriceData.payDId == 72) {
  461. this.OpVisaPriceDataRules.ctdId = [{ required: true, message: '请选择卡类型', trigger: ['blur', 'change'] },]
  462. this.OpVisaPriceDataRules.companyBankNo = []
  463. this.OpVisaPriceDataRules.otherBankName = []
  464. this.OpVisaPriceDataRules.otherSideNo = []
  465. this.OpVisaPriceDataRules.otherSideName = []
  466. } else if (this.OpVisaPriceData.payDId == 83) {
  467. this.OpVisaPriceDataRules.companyBankNo = []
  468. this.OpVisaPriceDataRules.otherBankName = [{ required: true, message: '对方开户行', trigger: ['blur', 'change'] },]
  469. this.OpVisaPriceDataRules.otherSideNo = [{ required: true, message: '对方银行卡号', trigger: ['blur', 'change'] },]
  470. this.OpVisaPriceDataRules.otherSideName = [{ required: true, message: '对方姓名', trigger: ['blur', 'change'] },]
  471. this.OpVisaPriceDataRules.ctdId = []
  472. } else {
  473. this.OpVisaPriceDataRules.companyBankNo = []
  474. this.OpVisaPriceDataRules.otherBankName = []
  475. this.OpVisaPriceDataRules.otherSideNo = []
  476. this.OpVisaPriceDataRules.otherSideName = []
  477. this.OpVisaPriceDataRules.ctdId = []
  478. }
  479. },
  480. ctdChange(id) {
  481. this.OpVisaPriceData.cardholderName = 'Zhang Hailin';
  482. for (var i = 0; i < this.bankCard.length; i++) {
  483. if (this.bankCard[i].id == parseInt(id)) {
  484. this.OpVisaPriceData.bankNo = this.bankCard[i].remark
  485. }
  486. }
  487. },
  488. //选择客户名单
  489. clientNamechange(val) {
  490. this.OpVisaPriceData.visaNumber = val.length;
  491. console.log(this.ClientFormat(this.OpVisaPriceData.visaClient))
  492. },
  493. //获取团组客户名单
  494. QueryClientInfoByDIID() {
  495. var url = "/api/Groups/QueryClientInfoByDIID"
  496. var that = this
  497. this.$axios({
  498. method: 'post',
  499. url: url,
  500. headers: {
  501. Authorization: 'Bearer ' + this.token
  502. },
  503. data: {
  504. diid: that.OpVisaPriceData.diId
  505. }
  506. }).then(function (res) {
  507. console.log(res);
  508. if (res.data.code == 200) {
  509. that.fliterClient = res.data.data;
  510. }
  511. })
  512. },
  513. //根据Id获取单挑数据及C表数据
  514. QueryVisaById() {
  515. var url = "/api/Groups/QueryVisaById"
  516. var that = this
  517. this.$axios({
  518. method: 'post',
  519. url: url,
  520. headers: {
  521. Authorization: 'Bearer ' + this.token
  522. },
  523. data: {
  524. id: that.OpVisaPriceData.id
  525. }
  526. }).then(function (res) {
  527. if (res.data.code == 200) {
  528. var CreditCardPayment = res.data.data.creditCardPayment;
  529. var VisaInfo = res.data.data.visaInfo;
  530. that.IsAuditGM = CreditCardPayment.isAuditGM;
  531. that.OpVisaPriceData.visaClient = that.ClientFormat(VisaInfo.visaClient);
  532. that.OpVisaPriceData.visaPrice = VisaInfo.visaPrice;
  533. that.OpVisaPriceData.visaCurrency = VisaInfo.visaCurrency;
  534. that.OpVisaPriceData.isThird = VisaInfo.isThird;
  535. that.OpVisaPriceData.passengerType = parseInt(VisaInfo.passengerType);
  536. that.OpVisaPriceData.visaNumber = VisaInfo.visaNumber;
  537. that.OpVisaPriceData.visaFreeNumber = VisaInfo.visaFreeNumber;
  538. that.OpVisaPriceData.createUserId = VisaInfo.createUserId;
  539. that.OpVisaPriceData.remark = VisaInfo.remark;
  540. that.OpVisaPriceData.payDId = CreditCardPayment.payDId;
  541. that.OpVisaPriceData.consumptionPatterns = CreditCardPayment.consumptionPatterns;
  542. that.OpVisaPriceData.consumptionDate = CreditCardPayment.consumptionDate;
  543. that.OpVisaPriceData.ctdId = CreditCardPayment.ctdId;
  544. that.OpVisaPriceData.bankNo = CreditCardPayment.bankNo;
  545. that.OpVisaPriceData.cardholderName = CreditCardPayment.cardholderName;
  546. that.OpVisaPriceData.companyBankNo = CreditCardPayment.companyBankNo
  547. that.OpVisaPriceData.otherBankName = CreditCardPayment.otherBankName
  548. that.OpVisaPriceData.otherSideNo = CreditCardPayment.otherSideNo
  549. that.OpVisaPriceData.otherSideName = CreditCardPayment.otherSideName
  550. that.OpVisaPriceData.payee = CreditCardPayment.payee;
  551. that.OpVisaPriceData.orbitalPrivateTransfer = CreditCardPayment.orbitalPrivateTransfer;
  552. that.OpVisaPriceData.cRemark = CreditCardPayment.remark;
  553. }
  554. })
  555. },
  556. //验证人数W
  557. verifytoll() {
  558. console.log(Number(this.OpVisaPriceData.visaNumber) + Number(this.OpVisaPriceData.visaFreeNumber) > this.OpVisaPriceData.visaClient.length)
  559. if (Number(this.OpVisaPriceData.visaNumber) + Number(this.OpVisaPriceData.visaFreeNumber) > this.OpVisaPriceData.visaClient.length) {
  560. this.$message.error("请检查人数");
  561. return
  562. } else {
  563. this.OpVisaPriceData.visaClient = this.ClientFormat(this.OpVisaPriceData.visaClient);
  564. }
  565. },
  566. addBtn() {
  567. if (this.IsAuditGM == 1) {
  568. this.$message.error('已通过审核,不可修改!');
  569. } else {
  570. if (this.OpVisaPriceData.diId == null && this.OpVisaPriceData.diId == undefined && this.OpVisaPriceData.diId == "") {
  571. this.$message.error("请选择团组名称");
  572. return;
  573. } else {
  574. const that = this;
  575. that.$refs.OpVisaPriceData.validate((valid) => {
  576. if (valid) {
  577. debugger
  578. that.OpVisaPriceData.createUserId = that.userId;
  579. if (that.OpVisaPriceData.ctdId == '') {
  580. that.OpVisaPriceData.ctdId = 0
  581. }
  582. that.verifytoll()
  583. var url = "/api/Groups/OpVisaPrice"
  584. that.$axios({
  585. method: 'post',
  586. url: url,
  587. headers: {
  588. Authorization: 'Bearer ' + that.token
  589. },
  590. data: that.OpVisaPriceData
  591. }).then(function (res) {
  592. if (res.data.code == 200) {
  593. that.$message({
  594. message: res.data.msg,
  595. type: 'success'
  596. });
  597. that.loading = true;
  598. setTimeout(() => {
  599. that.$router.push({
  600. path: "/home/VisaPriec",
  601. query: {
  602. diId: that.OpVisaPriceData.diId
  603. }
  604. })
  605. }, 3000);
  606. } else {
  607. that.$message.error(res.data.msg);
  608. }
  609. })
  610. } else {
  611. this.$message.error('请完善信息在保存!');
  612. return false;
  613. }
  614. })
  615. }
  616. }
  617. },
  618. EscAdd() {
  619. this.$router.push({
  620. path: "/home/VisaPriec",
  621. query: {
  622. diId: this.OpVisaPriceData.diId
  623. }
  624. })
  625. },
  626. //处理名单
  627. ClientFormat(val) {
  628. var result = [];
  629. if (typeof val == "string") {
  630. if (val.indexOf(',') != -1) {
  631. result = val.split(',').map(x => { return Number(x) }).filter(f => f > 0)
  632. } else {
  633. var clientId = Number(val);
  634. if (clientId > 0) {
  635. result = [clientId]
  636. }
  637. }
  638. } else if (Array.isArray(val)) {
  639. if (val.length > 0) {
  640. result = val.join();
  641. }
  642. } else {
  643. result = val;
  644. }
  645. return result;
  646. },
  647. QueryRate() {
  648. var url = "/api/Business/PostGroupTeamRateByDiIdAndCTableId"
  649. var that = this
  650. this.$axios({
  651. method: 'post',
  652. url: url,
  653. headers: {
  654. Authorization: 'Bearer ' + that.token
  655. },
  656. data: {
  657. "portType": 1,
  658. "diId": this.OpVisaPriceData.diId,
  659. "cTable": 80
  660. }
  661. }).then(function (res) {
  662. if (res.data.code == 200) {
  663. //汇率
  664. console.log("汇率--", res.data.data);
  665. that.rateList = res.data.data.teamRates;
  666. }
  667. })
  668. }
  669. },
  670. mounted() {
  671. this.OpVisaPriceData.diId = parseInt(this.$route.query.DiId);
  672. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  673. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  674. this.initializeSelect();
  675. this.QueryRate();
  676. this.OpVisaPriceData.id = this.$route.query.id;
  677. this.QueryClientInfoByDIID()
  678. if (this.OpVisaPriceData.id != null && this.OpVisaPriceData.id != undefined && this.OpVisaPriceData.id != 0) {
  679. this.QueryVisaById();
  680. this.title = "修改签证费用";
  681. this.OpVisaPriceData.status = 2;
  682. this.isShow = true;
  683. } else {
  684. this.OpVisaPriceData.status = 1;
  685. this.title = "新增签证费用";
  686. this.isShow = false;
  687. }
  688. }
  689. }
  690. </script>
  691. <style>
  692. .communal-list {
  693. background-color: #fff;
  694. padding: 10px;
  695. box-shadow: 0 0 5px #0005;
  696. border-radius: 10px;
  697. }
  698. .car_add .communal-title {
  699. display: flex;
  700. font-size: 17px;
  701. font-weight: 600;
  702. color: #555;
  703. margin-bottom: 20px;
  704. justify-content: space-between;
  705. align-items: center;
  706. }
  707. .appraise-box {
  708. display: flex;
  709. flex-wrap: wrap;
  710. justify-content: space-between;
  711. margin: 50px 0;
  712. }
  713. .appraise-box>div {
  714. width: 30%;
  715. }
  716. .communal-box {
  717. display: flex;
  718. }
  719. .communal-box>button {
  720. margin-left: 10px;
  721. padding: 8px 20px;
  722. }
  723. .car_add {
  724. background-color: #fff;
  725. padding: 20px;
  726. box-shadow: 0 0 5px #0005;
  727. border-radius: 10px;
  728. }
  729. @media screen and (max-width: 1700px) {
  730. .appraise-box>div {
  731. width: 48%;
  732. }
  733. .appraise-box>div el-form-item__content {
  734. width: 260px !important;
  735. }
  736. }
  737. </style>