OpLtinerary.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <div v-loading.fullscreen.lock="fullscreenLoading">
  3. <div class="opltinerary-all">
  4. <div class="opltinerary-head">
  5. <div class="opltinerary-head-li">
  6. <label>团组名称:</label>
  7. <el-select @change="InitOpTravel" style="width:210px" size="medium" v-model="value" filterable placeholder="请选择">
  8. <el-option
  9. v-for="item in options"
  10. :key="item.id"
  11. :label="item.teamName"
  12. :value="item.id">
  13. </el-option>
  14. </el-select>
  15. </div>
  16. <div class="opltinerary-head-li">
  17. <el-button @click="DelTravel" size="medium" type="primary">删除本团行程</el-button>
  18. <!-- <el-button size="medium" type="primary">导入数据</el-button> -->
  19. <el-button @click="TravelSave" size="medium" type="primary">保存修改</el-button>
  20. <el-button @click="dcwzxc" size="medium" type="primary">导出完整行程</el-button>
  21. <!-- <el-button size="medium" type="primary">导出下拉所选表格</el-button> -->
  22. </div>
  23. </div>
  24. <!-- <div class="opname-box">
  25. <div class="opname-head-li">
  26. <label>选择城市:</label>
  27. <el-select style="width:210px" size="medium" v-model="value" filterable placeholder="请选择">
  28. <el-option
  29. v-for="item in options"
  30. :key="item.id"
  31. :label="item.groupName"
  32. :value="item.id">
  33. </el-option>
  34. </el-select>
  35. </div>
  36. <div class="opname-head-li">
  37. <el-button size="medium" type="primary">导出城市行程</el-button>
  38. </div>
  39. </div>
  40. <div class="opname-box">
  41. <div class="opname-head-li">
  42. <label>选择行程单:</label>
  43. <el-select style="width:210px" size="medium" v-model="value" filterable placeholder="请选择">
  44. <el-option
  45. v-for="item in options"
  46. :key="item.id"
  47. :label="item.groupName"
  48. :value="item.id">
  49. </el-option>
  50. </el-select>
  51. </div>
  52. <div class="opname-head-li">
  53. <el-button size="medium" type="primary">新增数据</el-button>
  54. <el-button size="medium" type="primary">确定行程</el-button>
  55. </div>
  56. </div> -->
  57. <div class="itinerary-box">
  58. <div class="itinerary-title">
  59. {{ itineraryinfo.teamName}}
  60. </div>
  61. <div class="itinerary-inif">
  62. <div>途经城市:{{ itineraryinfo.city}}</div>
  63. <div>天数:{{ itineraryinfo.visitDays}}</div>
  64. <div>团号:{{ itineraryinfo.tourCode}}</div>
  65. <div>人数:{{ itineraryinfo.visitPNumber}}</div>
  66. </div>
  67. <div class="itinerary-table">
  68. <div class="table-title">
  69. <div style="width: 100px;">天数</div>
  70. <div style="width: 300px;">日期</div>
  71. <div style="width: 200px;">交通</div>
  72. <div style="width: 100%;">行程</div>
  73. </div>
  74. <div class="zwxcdxx" v-if="tablearrr.length<=0">
  75. 暂无行程单信息
  76. </div>
  77. <div v-else class="table-form" v-for="(item,index) in tablearrr" :key="index">
  78. <div class="table-form-li" style="width: 100px;">
  79. <el-input-number disabled style="width: 50px;" size="mini" :controls="false" v-model="item.days"></el-input-number>
  80. </div>
  81. <div class="table-form-li" style="width: 300px;">
  82. <el-input disabled style="width: 120px;" size="mini" v-model="item.date"></el-input>
  83. <br/>
  84. <el-input v-if="item.weekDay=='星期六'||item.weekDay=='星期日'" class="daycolor" disabled style="width: 120px;color: red;" size="mini" v-model="item.weekDay"></el-input>
  85. <el-input v-else disabled style="width: 120px;" size="mini" v-model="item.weekDay"></el-input>
  86. </div>
  87. <div class="table-form-li" style="width: 200px;">
  88. <el-input disabled style="width: 120px;" size="mini" v-model="item.traffic_First"></el-input>
  89. <br/>
  90. <el-input disabled style="width: 120px;" size="mini" v-model="item.traffic_Second"></el-input>
  91. </div>
  92. <div class="table-form-li" style="width: 100%;">
  93. <el-input
  94. style="width: 90%;"
  95. type="textarea"
  96. :autosize="{ minRows: 4, maxRows: 4}"
  97. placeholder="请输入内容"
  98. v-model="item.trip">
  99. </el-input>
  100. </div>
  101. </div>
  102. </div>
  103. <!-- <div class="briefly-box">
  104. <div class="briefly-select">
  105. <div class="briefly-select-li">
  106. <label>下拉选择国家:</label>
  107. <el-select style="width:150px" size="medium" v-model="value" filterable placeholder="请选择">
  108. <el-option
  109. v-for="item in options"
  110. :key="item.id"
  111. :label="item.groupName"
  112. :value="item.id">
  113. </el-option>
  114. </el-select>
  115. </div>
  116. <div class="briefly-select-li">
  117. <label>下拉选择城市:</label>
  118. <el-select style="width:150px" size="medium" v-model="value" filterable placeholder="请选择">
  119. <el-option
  120. v-for="item in options"
  121. :key="item.id"
  122. :label="item.groupName"
  123. :value="item.id">
  124. </el-option>
  125. </el-select>
  126. </div>
  127. </div>
  128. <div class="briefly-remark" style="width: 100%;">
  129. <label>国家简介:</label>
  130. <el-input
  131. type="textarea"
  132. :autosize="{ minRows: 4, maxRows: 4}"
  133. placeholder="国家简介"
  134. v-model="textarea2">
  135. </el-input>
  136. </div>
  137. <div class="briefly-remark" style="width: 100%;">
  138. <label>城市简介:</label>
  139. <el-input
  140. type="textarea"
  141. :autosize="{ minRows: 4, maxRows: 4}"
  142. placeholder="城市简介"
  143. v-model="textarea2">
  144. </el-input>
  145. </div>
  146. </div> -->
  147. </div>
  148. </div>
  149. </div>
  150. </template>
  151. <script>
  152. export default {
  153. data() {
  154. return {
  155. value:-1,
  156. options:[],
  157. values:'',
  158. textarea2:'',
  159. tablearrr:[
  160. ],
  161. itineraryinfo:{},
  162. userid:'',
  163. fullscreenLoading:false
  164. }
  165. },
  166. methods:{
  167. //行程单接口
  168. InitOpTravel() {
  169. this.fullscreenLoading=true;
  170. var url = "/api/Groups/InitOpTravel"
  171. var that = this
  172. this.$axios({
  173. method: 'post',
  174. url: url,
  175. headers: {
  176. Authorization: 'Bearer ' + this.token
  177. },
  178. data: {
  179. diid: that.value
  180. }
  181. }).then(function (res) {
  182. if (res.data.code == 200) {
  183. that.options=res.data.data.groupList;
  184. if(that.value==-1){
  185. that.value=that.options[0].id;
  186. }
  187. that.itineraryinfo=res.data.data.groupInfo;
  188. that.tablearrr=res.data.data.opTravelList;
  189. that.fullscreenLoading=false;
  190. }else{
  191. that.$message.error(res.data.msg);
  192. that.fullscreenLoading=false;
  193. }
  194. }).catch(function (error) {
  195. that.$message.error(error);
  196. that.fullscreenLoading=false;
  197. });
  198. },
  199. //删除本团行程
  200. DelTravel() {
  201. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  202. confirmButtonText: '确定',
  203. cancelButtonText: '取消',
  204. type: 'warning'
  205. }).then(() => {
  206. var url = "/api/Groups/DelTravel"
  207. var that = this
  208. this.$axios({
  209. method: 'post',
  210. url: url,
  211. headers: {
  212. Authorization: 'Bearer ' + this.token
  213. },
  214. data: {
  215. diid: that.value,
  216. userId: that.userid
  217. }
  218. }).then(function (res) {
  219. if (res.data.code == 200) {
  220. that.$message({
  221. message: res.data.msg,
  222. type: 'success',
  223. offset: 50
  224. });
  225. that.InitOpTravel();
  226. } else {
  227. that.$message.error(res.data.msg);
  228. }
  229. }).catch(function (error) {
  230. that.$message.error(error);
  231. });
  232. }).catch(() => {
  233. this.$message({
  234. type: 'info',
  235. message: '已取消删除'
  236. });
  237. });
  238. },
  239. //保存
  240. TravelSave() {
  241. var url = "/api/Groups/TravelSave"
  242. var that = this
  243. this.$axios({
  244. method: 'post',
  245. url: url,
  246. headers: {
  247. Authorization: 'Bearer ' + this.token
  248. },
  249. data: {
  250. arr: that.tablearrr,
  251. }
  252. }).then(function (res) {
  253. if (res.data.code == 200) {
  254. that.$message({
  255. message:res.data.msg ,
  256. type: 'success',
  257. offset:50
  258. });
  259. that.InitOpTravel();
  260. }else{
  261. that.$message.error(res.data.msg);
  262. }
  263. }).catch(function (error) {
  264. that.$message.error(error);
  265. });
  266. },
  267. //导出完整行程
  268. dcwzxc(){
  269. var url = "/api/Groups/ExportTravel"
  270. var that = this
  271. this.$axios({
  272. method: 'post',
  273. url: url,
  274. headers: {
  275. Authorization: 'Bearer ' + that.token
  276. },
  277. data: {
  278. diid: that.value,
  279. isPDF:0
  280. }
  281. }).then(function (res) {
  282. if (res.data.code == 200) {
  283. that.$message({
  284. message: res.data.msg,
  285. type: 'success',
  286. offset: 50
  287. });
  288. window.open(res.data.data.replace('C:/Server/File/OA2023/','http://132.232.92.186:24/'));
  289. } else {
  290. that.$message.error(res.data.msg);
  291. }
  292. }).catch(function (error) {
  293. that.$message.error(error);
  294. });
  295. }
  296. },
  297. created(){
  298. this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  299. this.InitOpTravel();
  300. }
  301. }
  302. </script>
  303. <style>
  304. .opltinerary-all{
  305. background-color: #fff;
  306. padding: 10px;
  307. box-shadow: 0 0 5px #0005;
  308. border-radius: 10px;
  309. height: 100%;
  310. min-height: 830px;
  311. }
  312. .opltinerary-head-li label{
  313. color: #606266;
  314. font-size: 15px;
  315. font-weight: 600;
  316. }
  317. .opltinerary-head{
  318. display: flex;
  319. justify-content: space-between;
  320. }
  321. .opname-box{
  322. display: flex;
  323. justify-content: flex-end;
  324. }
  325. .opname-head-li:nth-child(1){
  326. margin-right: 10px;
  327. }
  328. .opname-head-li{
  329. margin-top: 10px;
  330. }
  331. .opname-head-li label{
  332. color: #606266;
  333. font-size: 15px;
  334. font-weight: 600;
  335. }
  336. .itinerary-box{
  337. margin-top: 20px;
  338. }
  339. .itinerary-title{
  340. text-align: center;
  341. font-size: 17px;
  342. font-weight: 600;
  343. }
  344. .itinerary-inif{
  345. display: flex;
  346. justify-content: center;
  347. }
  348. .itinerary-inif div{
  349. margin-top: 10px;
  350. font-size: 14px;
  351. margin-right: 28px;
  352. }
  353. .itinerary-table{
  354. margin-top: 10px;
  355. }
  356. .table-title{
  357. display: flex;
  358. border: 1px solid #ebeef5;
  359. text-align: center;
  360. }
  361. .table-title div{
  362. padding: 10px 0px;
  363. }
  364. .table-title div:not(:first-child){
  365. border-left: 1px solid #ebeef5;
  366. }
  367. .table-form{
  368. display: flex;
  369. align-items: stretch;
  370. border: 1px solid #ebeef5;
  371. text-align: center;
  372. border-top: transparent;
  373. }
  374. .table-form .table-form-li{
  375. padding: 10px 0px;
  376. display: flex;
  377. flex-direction: column;
  378. justify-content: center;
  379. align-items: center;
  380. }
  381. .table-form-li:not(:first-child){
  382. border-left: 1px solid #ebeef5;
  383. }
  384. .briefly-box{
  385. margin-top: 30px;
  386. }
  387. .briefly-select-li{
  388. margin-right: 20px;
  389. }
  390. .briefly-select{
  391. display: flex;
  392. color:red;
  393. }
  394. .briefly-remark{
  395. margin-top: 10px;
  396. }
  397. .briefly-remark label{
  398. display: inline-block;
  399. margin-bottom: 10px;
  400. }
  401. .itinerary-table .el-input.is-disabled .el-input__inner{
  402. color: #606266;
  403. }
  404. .opltinerary-all .itinerary-table .daycolor .el-input__inner{
  405. color: red;
  406. }
  407. .zwxcdxx{
  408. font-size: 14px;
  409. color: #606266;
  410. border-left:1px solid #ebeef5;
  411. border-bottom:1px solid #ebeef5;
  412. border-right:1px solid #ebeef5;
  413. text-align: center;
  414. padding: 30px;
  415. }
  416. </style>