OpVisaPriec.vue 40 KB

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