OpCarTouristGuideGroundId.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  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="OpCarTouristGuideGroundData.diId" clearable filterable placeholder="团组选择"
  15. :disabled="isShow" style="width: 220px;" @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. <div style="display: flex;">
  62. <div style="width: 25%;">
  63. <el-form-item label="OP提成等级:" prop="tourCode" label-width="160px">
  64. <el-select v-model="delegationInfo.opRoyaltyLv" clearable filterable placeholder="等级"
  65. :disabled="true" style="width: 220px;">
  66. <el-option v-for="item in opRoyaltyLvList" :key="item.id" :label="item.name + '元'"
  67. :value="item.id">
  68. </el-option>
  69. </el-select>
  70. </el-form-item>
  71. </div>
  72. <div style="width: 60%;">
  73. <el-form-item label="Op提成等级说明:" prop="opRoyaltyRemark" label-width="160px">
  74. <el-input placeholder="Op提成等级说明" v-model="delegationInfo.opRoyaltyRemark" :disabled="true">
  75. </el-input>
  76. </el-form-item>
  77. </div>
  78. </div>
  79. </el-form>
  80. <el-form :model="OpCarTouristGuideGroundData" ref="OpCarTouristGuideGroundData"
  81. :rules="OpCarTouristGuideGroundDataRules" label-width="100px" class="demo-ruleForm">
  82. <div style="display: flex;">
  83. <div style="width: 25%;">
  84. <el-form-item label="地区:" prop="area" label-width="160px">
  85. <el-input placeholder="地区" v-model="OpCarTouristGuideGroundData.area">
  86. </el-input>
  87. </el-form-item>
  88. </div>
  89. <div style="width: 25%;">
  90. <el-form-item label="服务时间起:" prop="serviceStartTime" label-width="160px">
  91. <el-date-picker v-model="OpCarTouristGuideGroundData.serviceStartTime" type="date"
  92. value-format="yyyy-MM-dd" placeholder="服务时间起">
  93. </el-date-picker>
  94. </el-form-item>
  95. </div>
  96. <div style="width: 25%;">
  97. <el-form-item label="服务时间止:" prop="serviceEndTime" label-width="160px">
  98. <el-date-picker v-model="OpCarTouristGuideGroundData.serviceEndTime" type="date"
  99. value-format="yyyy-MM-dd" placeholder="服务时间止">
  100. </el-date-picker>
  101. </el-form-item>
  102. </div>
  103. <div style="width: 25%;">
  104. <el-form-item label="服务公司:" prop="serviceCompany" label-width="160px">
  105. <el-input placeholder="服务公司" v-model="OpCarTouristGuideGroundData.serviceCompany">
  106. </el-input>
  107. </el-form-item>
  108. </div>
  109. </div>
  110. <div style="display: flex;">
  111. <div style="width: 25%;">
  112. <el-form-item label="地接导游:" prop="serviceGuide" label-width="160px">
  113. <el-input placeholder="地接导游" v-model="OpCarTouristGuideGroundData.serviceGuide">
  114. </el-input>
  115. </el-form-item>
  116. </div>
  117. <div style="width: 25%;">
  118. <el-form-item label="联系电话:" prop="serviceTel" label-width="160px">
  119. <el-input placeholder="联系电话" v-model="OpCarTouristGuideGroundData.serviceTel">
  120. </el-input>
  121. </el-form-item>
  122. </div>
  123. <div style="width: 25%;">
  124. <el-form-item label="Bus名称:" prop="busName" label-width="160px">
  125. <el-input placeholder="Bus名称" v-model="OpCarTouristGuideGroundData.busName">
  126. </el-input>
  127. </el-form-item>
  128. </div>
  129. <div style="width: 25%;">
  130. <el-form-item label="联系电话:" prop="busTel" label-width="160px">
  131. <el-input placeholder="联系电话" v-model="OpCarTouristGuideGroundData.busTel">
  132. </el-input>
  133. </el-form-item>
  134. </div>
  135. </div>
  136. <div style="display: flex;">
  137. <div style="width: 25%;">
  138. <el-form-item label="费用表示:" prop="orbitalPrivateTransfer" label-width="160px">
  139. <el-select v-model="OpCarTouristGuideGroundData.orbitalPrivateTransfer" clearable filterable
  140. placeholder="费用标识" style="width: 220px;">
  141. <el-option :key=0 :value="0" label="公转"></el-option>
  142. <el-option :key=1 :value="1" label="私转"></el-option>
  143. </el-select>
  144. </el-form-item>
  145. </div>
  146. </div>
  147. <div style="display: flex;">
  148. <div style="width: 100%;">
  149. <el-form-item label="Bus描述:" prop="busDescription" label-width="160px">
  150. <el-input type="textarea" :rows="2" placeholder="Bus描述"
  151. v-model="OpCarTouristGuideGroundData.busDescription"></el-input>
  152. </el-form-item>
  153. </div>
  154. </div>
  155. <div style="display: flex;">
  156. <div style="width: 100%;">
  157. <el-form-item label="服务描述:" prop="serviceDescription" label-width="160px">
  158. <el-input type="textarea" :rows="2" placeholder="服务描述"
  159. v-model="OpCarTouristGuideGroundData.serviceDescription"></el-input>
  160. </el-form-item>
  161. </div>
  162. </div>
  163. <div style="display: flex;">
  164. <div style="width: 100%;">
  165. <el-form-item label="备 注:" prop="remark" label-width="160px">
  166. <el-input type="textarea" :rows="5" placeholder="备注"
  167. v-model="OpCarTouristGuideGroundData.remark"></el-input>
  168. </el-form-item>
  169. </div>
  170. </div>
  171. <el-form-item>
  172. <div style="margin-left: 60%;">
  173. <el-button type="primary" @click="addBtn">保存</el-button>
  174. <el-button @click="EscAdd">取消</el-button>
  175. </div>
  176. </el-form-item>
  177. </el-form>
  178. </div>
  179. </div>
  180. </template>
  181. <script>
  182. import { dE } from '@fullcalendar/core/internal-common';
  183. export default {
  184. data() {
  185. return {
  186. title: "新增Op费用",
  187. token: '',
  188. userId: 0,
  189. isShow: false,
  190. delegationInfo: {},
  191. delegationInfoList: [],//团组下拉框
  192. OpCarTouristGuideGroundData: {
  193. status: 0,
  194. id: 0,
  195. diId: 0,
  196. area: '',
  197. serviceCompany: '',
  198. serviceGuide: '',
  199. serviceTel: '',
  200. busName: '',
  201. busDescription: '',
  202. busTel: '',
  203. serviceStartTime: '',
  204. serviceEndTime: '',
  205. serviceDescription: '',
  206. orbitalPrivateTransfer: 0,
  207. createUserId: 0,
  208. remark: ''
  209. },
  210. IsAuditGM: 0,
  211. VisitDate: '',
  212. opRoyaltyLvList: [],
  213. transformDateFormat: function (value) {
  214. // 将value转换为Date对象
  215. var date = new Date(value);
  216. // 获取年、月、日
  217. var year = date.getFullYear();
  218. var month = date.getMonth() + 1;
  219. var day = date.getDate();
  220. // 将月份和日期转换为两位数的格式
  221. if (month < 10) {
  222. month = '0' + month;
  223. }
  224. if (day < 10) {
  225. day = '0' + day;
  226. }
  227. // 返回格式化后的日期字符串
  228. return year + '-' + month + '-' + day;
  229. },
  230. OpCarTouristGuideGroundDataRules: {
  231. area: [
  232. { required: true, message: '请输入地区', trigger: ['blur', 'change'] },
  233. ],
  234. serviceCompany: { required: true, message: '请输入服务公司', trigger: ['blur', 'change'] },
  235. serviceGuide: { required: true, message: '请输入服务导游', trigger: ['blur', 'change'] },
  236. serviceTel: { required: true, message: '请输入导游地接联系电话', trigger: ['blur', 'change'] },
  237. busName: { required: true, message: '请输入Bus名称', trigger: ['blur', 'change'] },
  238. busTel: { required: true, message: '请输入车公司联系电话', trigger: ['blur', 'change'] },
  239. serviceStartTime: { required: true, message: '请输入服务时间起', trigger: ['blur', 'change'] },
  240. serviceEndTime: { required: true, message: '请输入服务时间止', trigger: ['blur', 'change'] },
  241. orbitalPrivateTransfer: { required: true, message: '请选择费用表示', trigger: ['blur', 'change'] },
  242. }
  243. }
  244. },
  245. methods: {
  246. //初始化下拉框
  247. initializeSelect() {
  248. var url = "/api/System/QuerySetData"
  249. var that = this
  250. this.$axios({
  251. method: 'post',
  252. url: url,
  253. headers: {
  254. Authorization: 'Bearer ' + this.token
  255. },
  256. data: {
  257. dataType: 70,
  258. }
  259. }).then(function (res) {
  260. if (res.data.code == 200) {
  261. that.opRoyaltyLvList = res.data.data;
  262. var url = "/api/Groups/DecreasePaymentsSelect"
  263. that.$axios({
  264. method: 'post',
  265. url: url,
  266. headers: {
  267. Authorization: 'Bearer ' + that.token
  268. },
  269. data: {
  270. userId: that.userId,
  271. ctId: 79
  272. }
  273. }).then(function (res) {
  274. if (res.data.code == 200) {
  275. debugger
  276. that.delegationInfoList = res.data.data.groupName;
  277. for (let index = 0; index < that.delegationInfoList.length; index++) {
  278. debugger
  279. if (that.delegationInfoList[index].id == that.OpCarTouristGuideGroundData.diId) {
  280. that.delegationInfo = that.delegationInfoList[index];
  281. that.VisitDate = that.transformDateFormat(that.delegationInfo.visitStartDate) + '至' + that.transformDateFormat(that.delegationInfo.visitEndDate);
  282. debugger
  283. that.delegationInfo.opRoyaltyLv = that.delegationInfo.opRoyaltyLv
  284. break;
  285. }
  286. }
  287. }
  288. })
  289. }
  290. })
  291. //团组下拉框绑定
  292. },
  293. DiIdSelectChange() {
  294. var that = this;
  295. for (let index = 0; index < that.delegationInfoList.length; index++) {
  296. if (that.delegationInfoList[index].id == that.OpCarTouristGuideGroundData.diId) {
  297. that.delegationInfo = that.delegationInfoList[index];
  298. that.VisitDate = that.transformDateFormat(that.delegationInfo.visitStartDate) + '至' + that.transformDateFormat(that.delegationInfo.visitEndDate);
  299. break;
  300. }
  301. }
  302. },
  303. //根据Id获取单挑数据及C表数据
  304. QueryCarTouristGuideGroundById() {
  305. var url = "/api/Groups/QueryCarTouristGuideGroundById"
  306. var that = this
  307. this.$axios({
  308. method: 'post',
  309. url: url,
  310. headers: {
  311. Authorization: 'Bearer ' + this.token
  312. },
  313. data: {
  314. id: that.OpCarTouristGuideGroundData.id
  315. }
  316. }).then(function (res) {
  317. if (res.data.code == 200) {
  318. debugger
  319. var CreditCardPayment = res.data.data.creditCardPayment;
  320. var carTouristGuideGround = res.data.data.carTouristGuideGround;
  321. if (CreditCardPayment != null) {
  322. that.IsAuditGM = CreditCardPayment.isAuditGM;
  323. }
  324. that.OpCarTouristGuideGroundData.area = carTouristGuideGround.area
  325. that.OpCarTouristGuideGroundData.serviceCompany = carTouristGuideGround.serviceCompany
  326. that.OpCarTouristGuideGroundData.serviceGuide = carTouristGuideGround.serviceGuide
  327. that.OpCarTouristGuideGroundData.serviceTel = carTouristGuideGround.serviceTel
  328. that.OpCarTouristGuideGroundData.busName = carTouristGuideGround.busName
  329. that.OpCarTouristGuideGroundData.busDescription = carTouristGuideGround.busDescription
  330. that.OpCarTouristGuideGroundData.busTel = carTouristGuideGround.busTel
  331. that.OpCarTouristGuideGroundData.serviceStartTime = carTouristGuideGround.serviceStartTime
  332. that.OpCarTouristGuideGroundData.serviceEndTime = carTouristGuideGround.serviceEndTime
  333. that.OpCarTouristGuideGroundData.serviceDescription = carTouristGuideGround.serviceDescription
  334. that.OpCarTouristGuideGroundData.orbitalPrivateTransfer = carTouristGuideGround.orbitalPrivateTransfer
  335. that.OpCarTouristGuideGroundData.remark = carTouristGuideGround.remark
  336. }
  337. })
  338. },
  339. addBtn() {
  340. if (this.IsAuditGM == 1) {
  341. this.$message.error('已通过审核,不可修改!');
  342. } else {
  343. if (this.OpCarTouristGuideGroundData.diId == null && this.OpCarTouristGuideGroundData.diId == undefined && this.OpCarTouristGuideGroundData.diId == "") {
  344. this.$message.error("请选择团组名称");
  345. return;
  346. } else {
  347. const that = this;
  348. that.$refs.OpCarTouristGuideGroundData.validate((valid) => {
  349. if (valid) {
  350. var url = "/api/Groups/OpCarTouristGuideGround"
  351. that.$axios({
  352. method: 'post',
  353. url: url,
  354. headers: {
  355. Authorization: 'Bearer ' + that.token
  356. },
  357. data: that.OpCarTouristGuideGroundData
  358. }).then(function (res) {
  359. if (res.data.code == 200) {
  360. that.$message({
  361. message: res.data.msg,
  362. type: 'success'
  363. });
  364. setTimeout(() => {
  365. that.$router.push('/home/CarTouristGuideGroundId?diId='+that.OpCarTouristGuideGroundData.diId+'')
  366. }, 3000);
  367. } else {
  368. that.$message.error(res.data.msg);
  369. }
  370. })
  371. } else {
  372. this.$message.error('请完善信息在保存!');
  373. return false;
  374. }
  375. })
  376. }
  377. }
  378. },
  379. EscAdd() {
  380. this.$router.push({
  381. path: "/home/CarTouristGuideGroundId",
  382. query: {
  383. diId: this.OpCarTouristGuideGroundData.diId
  384. }
  385. })
  386. }
  387. },
  388. mounted() {
  389. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  390. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
  391. this.initializeSelect();
  392. this.OpCarTouristGuideGroundData.diId = parseInt(this.$route.query.DiId)
  393. this.OpCarTouristGuideGroundData.id = this.$route.query.id
  394. this.OpCarTouristGuideGroundData.createUserId = this.userId
  395. debugger
  396. if (this.OpCarTouristGuideGroundData.id != null && this.OpCarTouristGuideGroundData.id != undefined && this.OpCarTouristGuideGroundData.id != 0) {
  397. this.QueryCarTouristGuideGroundById();
  398. this.title = "修改签证费用";
  399. this.OpCarTouristGuideGroundData.status = 2
  400. this.isShow = true
  401. } else {
  402. this.OpCarTouristGuideGroundData.status = 1
  403. this.title = "新增签证费用"
  404. this.isShow = false
  405. }
  406. }
  407. }
  408. </script>
  409. <style>
  410. .communal-list {
  411. background-color: #fff;
  412. padding: 10px;
  413. box-shadow: 0 0 5px #0005;
  414. border-radius: 10px;
  415. }
  416. .car_add .communal-title {
  417. display: flex;
  418. font-size: 17px;
  419. font-weight: 600;
  420. color: #555;
  421. margin-bottom: 20px;
  422. justify-content: space-between;
  423. align-items: center;
  424. }
  425. .appraise-box {
  426. display: flex;
  427. flex-wrap: wrap;
  428. justify-content: space-between;
  429. margin: 50px 0;
  430. }
  431. .appraise-box>div {
  432. width: 30%;
  433. }
  434. .communal-box {
  435. display: flex;
  436. }
  437. .communal-box>button {
  438. margin-left: 10px;
  439. padding: 8px 20px;
  440. }
  441. .car_add {
  442. background-color: #fff;
  443. padding: 20px;
  444. box-shadow: 0 0 5px #0005;
  445. border-radius: 10px;
  446. }
  447. @media screen and (max-width: 1700px) {
  448. .appraise-box>div {
  449. width: 48%;
  450. }
  451. .appraise-box>div el-form-item__content {
  452. width: 260px !important;
  453. }
  454. }
  455. </style>