OpCarTouristGuideGroundId.vue 24 KB

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