酒店预订平台
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

524 Zeilen
23 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <!-- import CSS -->
  6. <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  7. </head>
  8. <body>
  9. <div id="app" class="table">
  10. <div>
  11. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  12. <span>订单ID:</span>
  13. <el-input v-model="search.order_id" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
  14. <span>订单状态:</span>
  15. <el-select v-model="search.order_status" style="width: 150px;" placeholder="请选择" clearable>
  16. <el-option
  17. v-for="item in orderMainStatus"
  18. :key="item.id"
  19. :label="item.name"
  20. :value="item.id">
  21. </el-option>
  22. </el-select>
  23. <span>收款单ID:</span>
  24. <el-input v-model="search.receipt_order_id" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
  25. <span>收款单状态</span>
  26. <el-select v-model="search.receipt_order_status" style="width: 150px;" placeholder="请选择" clearable>
  27. <el-option
  28. v-for="item in receiptStatus"
  29. :key="item.id"
  30. :label="item.name"
  31. :value="item.id">
  32. </el-option>
  33. </el-select>
  34. <span>用户名</span>
  35. <el-input v-model="search.user_name" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
  36. <span>手机号</span>
  37. <el-input v-model="search.user_phone" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
  38. </div>
  39. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  40. <span>渠道订单号:</span>
  41. <el-input v-model="search.channel_order_no" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
  42. <span>渠道:</span>
  43. <el-select v-model="search.channel_id" style="width: 150px;" placeholder="请选择" clearable>
  44. <el-option
  45. v-for="item in channelList"
  46. :key="item.id"
  47. :label="item.name"
  48. :value="item.id">
  49. </el-option>
  50. </el-select>
  51. <span>专员</span>
  52. <el-select v-model="search.commissioner_id" style="width: 150px;" placeholder="请选择" clearable>
  53. <el-option
  54. v-for="item in userList"
  55. :key="item.id"
  56. :label="item.name"
  57. :value="item.id">
  58. </el-option>
  59. </el-select>
  60. <span>下单人</span>
  61. <el-select v-model="search.create_id" style="width: 150px;" placeholder="请选择" clearable>
  62. <el-option
  63. v-for="item in userList"
  64. :key="item.id"
  65. :label="item.name"
  66. :value="item.id">
  67. </el-option>
  68. </el-select>
  69. <span>时间</span>
  70. <el-date-picker
  71. style="width: 150px;"
  72. v-model="search.startTime"
  73. type="date"
  74. value-format="yyyy-MM-dd"
  75. placeholder="选择日期">
  76. </el-date-picker>
  77. ~
  78. <el-date-picker
  79. style="width: 150px;"
  80. v-model="search.endTime"
  81. value-format="yyyy-MM-dd"
  82. type="date"
  83. placeholder="选择日期">
  84. </el-date-picker>
  85. </div>
  86. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  87. <span>金额</span>
  88. <el-input-number v-model="search.startMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  89. ~
  90. <el-input-number v-model="search.endMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  91. <span>成本</span>
  92. <el-input-number v-model="search.startCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  93. ~
  94. <el-input-number v-model="search.endCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  95. <span>利润</span>
  96. <el-input-number v-model="search.startProfit" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  97. ~
  98. <el-input-number v-model="search.endProfit" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  99. <el-button type="primary" icon="el-icon-search" @click="getData(1)">搜索</el-button>
  100. <el-button type="primary" icon="el-icon-plus" @click="addShow=true" >新增</el-button>
  101. </div>
  102. <el-table ref="multipleTable" :data="tableData" border tooltip-effect="dark"
  103. style="font-size:12px;width: 100%;margin-top: 12px">
  104. <el-table-column prop="id" label="订单ID" min-width="30" ></el-table-column>
  105. <el-table-column prop="commissioner" label="专员" min-width="40" ></el-table-column>
  106. <el-table-column prop="channel_order_no" label="渠道" min-width="120" >
  107. <template slot-scope="scope">
  108. <div><i class="el-icon-user" v-html="scope.row.channel_name"></i></div>
  109. <div><i class="el-icon-tickets" v-html="scope.row.channel_order_no"></i></div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column prop="create_id" label="下单人" min-width="50" :formatter="getUserName"></el-table-column>
  113. <el-table-column prop="user_name" label="用户" min-width="80" >
  114. <template slot-scope="scope">
  115. <div><i class="el-icon-user-solid" v-html="scope.row.user_name"></i></div>
  116. <div><i class="el-icon-phone" v-html="scope.row.user_phone"></i></div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="total_amount" label="金额" min-width="80" >
  120. <template slot-scope="scope">
  121. <div v-html="'金额:'+scope.row.total_amount"></div>
  122. <div v-html="'成本:'+scope.row.cost_amount"></div>
  123. <div v-html="'利润:'+scope.row.profit_amount"></div>
  124. </template>
  125. </el-table-column>
  126. <el-table-column prop="order_status" label="状态" min-width="40" :formatter="getOrderMainStatus"></el-table-column>
  127. <el-table-column prop="create_time" label="时间" min-width="100" >
  128. <template slot-scope="scope">
  129. <div ><i v-html="'下单:'+scope.row.create_time"></i></div>
  130. <div v-if="scope.row.success_time"><i v-html="'成功:'+scope.row.success_time"></i></div>
  131. <div v-if="scope.row.cancel_time"><i v-html="'取消:'+scope.row.cancel_time"></i></div>
  132. </template>
  133. </el-table-column>
  134. <el-table-column prop="receipt_order_name" label="收款单" min-width="100" >
  135. <template slot-scope="scope">
  136. <div v-if="scope.row.receipt_order_id!=0">
  137. <div v-html="'ID:'+scope.row.receipt_order_id"></div>
  138. <div v-html="'NAME:'+scope.row.receipt_order_name"></div>
  139. <div v-html="'状态:'+getReceiptOrderStatus(scope.row)" ></div>
  140. </div>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="子订单" type="expand">
  144. <template slot-scope="scope">
  145. <el-table ref="multipleTable" :data="scope.row.subOrder" border tooltip-effect="dark"
  146. style="font-size:12px;width: 94%;margin-left: 2%;margin-right: 4%">
  147. <el-table-column prop="id" label="订单ID" min-width="30" ></el-table-column>
  148. <el-table-column prop="type" label="类型" min-width="30" ></el-table-column>
  149. <el-table-column label="名称" min-width="80" >
  150. <template slot-scope="prop">
  151. <div v-if="prop.row.type=='酒店'" v-html="prop.row.hotel_name"></div>
  152. <div v-if="prop.row.type=='附加项目'" v-html="prop.row.item_name"></div>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="房型/项目类型" min-width="80" >
  156. <template slot-scope="prop">
  157. <div v-if="prop.row.type=='酒店'" v-html="prop.row.room_name"></div>
  158. <div v-if="prop.row.type=='附加项目'" v-html="getTypeName(prop.row)"></div>
  159. </template>
  160. </el-table-column>
  161. <el-table-column prop="id" label="时间" min-width="40" >
  162. <template slot-scope="prop">
  163. <div v-if="prop.row.type=='酒店'" >
  164. <div v-html="prop.row.check_in_date"></div>
  165. <div v-html="prop.row.check_out_date"></div>
  166. </div>
  167. <div v-if="prop.row.type=='附加项目'" v-html="prop.row.check_in_date"></div>
  168. </template>
  169. </el-table-column>
  170. <el-table-column prop="prod_num" label="数量" min-width="20" ></el-table-column>
  171. <el-table-column prop="customer_name" label="出游人姓名" min-width="40" ></el-table-column>
  172. <el-table-column prop="total_price" label="金额" min-width="30" ></el-table-column>
  173. <el-table-column prop="total_cost" label="成本" min-width="30" ></el-table-column>
  174. <el-table-column prop="profit" label="利润" min-width="30" ></el-table-column>
  175. <el-table-column label="发单状态" min-width="30" :formatter="confirmStatusName"></el-table-column>
  176. <el-table-column prop="payment_order_name" label="付款单" min-width="40" >
  177. <template slot-scope="scope">
  178. <div v-if="scope.row.payment_order_id" v-html="scope.row.payment_order_id"></div>
  179. <div v-if="scope.row.payment_order_id" v-html="scope.row.payment_order_name"></div>
  180. </template>
  181. </el-table-column>
  182. <el-table-column label="付款单状态" min-width="40" :formatter="paymentOrderStatus" ></el-table-column>
  183. </el-table>
  184. </template>
  185. </el-table-column>
  186. <el-table-column prop="receipt_order_name" label="备注" min-width="80" >
  187. <template slot-scope="scope">
  188. <el-popover
  189. placement="top-start"
  190. title=""
  191. width="200"
  192. trigger="hover"
  193. :content="scope.row.order_memo">
  194. <div slot="reference" v-html="scope.row.order_memo" style="overflow:hidden;white-space: nowrap;"></div>
  195. </el-popover>
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="操作" min-width="70">
  199. <template slot-scope="scope">
  200. <el-button-group>
  201. <el-button type="primary" size="mini" @click="edit(scope.row.id)" icon="el-icon-edit">编辑</el-button>
  202. </el-button-group>
  203. </template>
  204. </el-table-column>
  205. </el-table>
  206. <el-pagination
  207. :page-size="search.pageSize"
  208. :pager-count="11"
  209. layout="total, sizes, prev, pager, next, jumper"
  210. :total="total"
  211. :current-page="search.pageNum"
  212. :page-sizes="[10, 20, 30, 40, 50]"
  213. @size-change="sizeChange"
  214. @current-change="getData"
  215. @prev-click="getData"
  216. @next-click="getData"
  217. ></el-pagination>
  218. </div>
  219. <transition name="bounce" v-if="addShow">
  220. <el-dialog title="新增订单" :visible.sync="addShow" width="90%" height="100%" top="15px">
  221. <iframe src="/view/order_main/add.html" frameborder="0" width="99%" id="addPageShow" onload="this.height=100"></iframe>
  222. </el-dialog>
  223. </transition>
  224. <transition name="bounce" v-if="editShow">
  225. <el-dialog title="编辑订单" :visible.sync="editShow" width="90%" height="100%" top="15px">
  226. <iframe :src="editPageShowUrl" frameborder="0" width="99%" id="editPageShow" onload="this.height=100"></iframe>
  227. </el-dialog>
  228. </transition>
  229. </div>
  230. </body>
  231. <!-- import Vue before Element -->
  232. <script src="/assets/js/vue/vue.js"></script>
  233. <!-- import JavaScript -->
  234. <script src="/assets/js/vue/index.js"></script>
  235. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  236. <script type="text/javascript">
  237. function reinitIframe(){
  238. try{
  239. var iframe = document.getElementById("addPageShow");
  240. var bHeight = iframe.contentWindow.document.body.scrollHeight;
  241. var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
  242. var height = Math.max(bHeight, dHeight);
  243. iframe.height = height;
  244. console.log(height);
  245. }catch (ex){}
  246. try{
  247. var iframe1 = document.getElementById("editPageShow");
  248. var bHeight1 = iframe1.contentWindow.document.body.scrollHeight;
  249. var dHeight1 = iframe1.contentWindow.document.documentElement.scrollHeight;
  250. var height1 = Math.max(bHeight1, dHeight1);
  251. iframe1.height = height1;
  252. console.log(height1);
  253. }catch (ex){}
  254. }
  255. window.setInterval("reinitIframe()", 200);
  256. </script>
  257. <script>
  258. new Vue({
  259. el: '#app',
  260. data: function () {
  261. return {
  262. search: {
  263. "receipt_order_id":"",
  264. "receipt_order_status":"",
  265. "order_id":"",
  266. "channel_order_no":"",
  267. "channel_id":"",
  268. "order_status":"",
  269. "commissioner_id":"",
  270. "user_name":"",
  271. "user_phone":"",
  272. "create_id":"",
  273. "startMoney":"",
  274. "endMoney":"",
  275. "startCost":"",
  276. "endCost":"",
  277. "startProfit":"",
  278. "endProfit":"",
  279. "startTime":"",
  280. "endTime":"",
  281. "pageNum":1,
  282. "pageSize":10
  283. },
  284. total: 0,
  285. tableData: [],
  286. province: [],
  287. city: [],
  288. area:[],
  289. editShow:false,
  290. editPageShowUrl:"",
  291. addShow:false,
  292. //收款单状态 0:未收款 1:收款中 2已收款
  293. receiptStatus:[
  294. {id:0,name:"未收款"},
  295. {id:1,name:"收款中"},
  296. {id:2,name:"已收款"},
  297. ],
  298. //0待处理 1已确认 2部分取消 10已完成 11已取消
  299. orderMainStatus:[
  300. {id:0,name:"待处理"},
  301. {id:1,name:"已确认"},
  302. {id:2,name:"部分取消"},
  303. {id:3,name:"处理中"},
  304. {id:10,name:"已完成"},
  305. {id:11,name:"已取消"}
  306. ],
  307. userList: [],
  308. channelList:[],
  309. multipleSelection: [],
  310. confirmStatusList:[
  311. {id:1,name:"未发单"},
  312. {id:2,name:"已发单"},
  313. {id:3,name:"已确认"},
  314. {id:4,name:"已取消"}
  315. ],
  316. paymentOrderStatusList:[
  317. {"id": 0, 'value': "未付款"},
  318. {"id": 1, 'value': "付款中"},
  319. {"id": 2, 'value': "已付款"}
  320. ],
  321. type_list:[],
  322. }
  323. },
  324. created() {
  325. window.addEventListener("message", e => {
  326. this.editShow = false
  327. this.addShow = false
  328. this.getData(1)
  329. });
  330. this.getAdminUser();
  331. this.getChannelList();
  332. this.getProvince();
  333. this.getConfig()
  334. this.getData(1)
  335. },
  336. watch: {
  337. "search.province" : function (newVal,oldVal){
  338. this.city = []
  339. this.area = []
  340. this.search.city=""
  341. this.search.area=""
  342. if (newVal==''){
  343. return false;
  344. }
  345. let row = {
  346. "province":newVal
  347. }
  348. axios.post("/hotel.php/ajax/areaList", row).then((response) => {
  349. let data = response.data;
  350. if (data.flag) {
  351. this.city = data.data;
  352. } else {
  353. this.$message.error(data.msg);
  354. }
  355. }).catch(function (error) {
  356. console.log(error);
  357. });
  358. },
  359. "search.city" : function (newVal,oldVal){
  360. this.area = []
  361. this.search.area=""
  362. if (newVal == "") {
  363. return false;
  364. }
  365. let row = {
  366. province:this.search.province,
  367. city:newVal
  368. }
  369. axios.post("/hotel.php/ajax/areaList", row).then((response) => {
  370. let data = response.data;
  371. if (data.flag) {
  372. this.area = data.data;
  373. } else {
  374. this.$message.error(data.msg);
  375. }
  376. }).catch(function (error) {
  377. console.log(error);
  378. });
  379. },
  380. },
  381. methods: {
  382. getTypeName(info) {
  383. for (let i = 0; i < this.type_list.length; i++) {
  384. if (this.type_list[i].id == info.item_type) {
  385. return this.type_list[i].name
  386. }
  387. }
  388. return ""
  389. },
  390. getConfig(){
  391. axios.post("/hotel.php/general/config/getList?key=site.item_category", {}).then((response) => {
  392. let data = response.data;
  393. this.type_list = data.list;
  394. }).catch(function (error) {
  395. console.log(error);
  396. });
  397. },
  398. paymentOrderStatus(info){
  399. if (info.payment_order_id ==0) {
  400. return "-"
  401. }
  402. for (let i = 0; i < this.paymentOrderStatusList.length; i++) {
  403. if (this.paymentOrderStatusList[i].id == info.payment_order_status) {
  404. return this.paymentOrderStatusList[i].value
  405. }
  406. }
  407. return "-"
  408. },
  409. confirmStatusName(info){
  410. for (let i = 0; i < this.confirmStatusList.length; i++) {
  411. if (this.confirmStatusList[i].id == info.confirm_status) {
  412. return this.confirmStatusList[i].name
  413. }
  414. }
  415. return "-"
  416. },
  417. getReceiptOrderStatus(info){
  418. for (let i = 0; i < this.receiptStatus.length; i++) {
  419. if (this.receiptStatus[i].id == info.receipt_order_status) {
  420. return this.receiptStatus[i].name
  421. }
  422. }
  423. return "-"
  424. },
  425. getChannelList(){
  426. axios.post("/hotel.php/cf_channel_info/getList", this.search).then((response) => {
  427. console.log(response)
  428. let data = response.data;
  429. this.channelList = data.list;
  430. }).catch(function (error) {
  431. console.log(error);
  432. });
  433. },
  434. getUserName(info) {
  435. for (let i = 0; i < this.userList.length; i++) {
  436. if (this.userList[i].id == info.create_id) {
  437. return this.userList[i].name
  438. }
  439. }
  440. return "-"
  441. },
  442. getOrderMainStatus(info){
  443. for (let i = 0; i < this.orderMainStatus.length; i++) {
  444. if (this.orderMainStatus[i].id == info.order_status) {
  445. return this.orderMainStatus[i].name
  446. }
  447. }
  448. return "-"
  449. },
  450. getAdminUser() {
  451. axios.post("/hotel.php/auth/admin/getList", this.search).then((response) => {
  452. this.userList = response.data.list;
  453. }).catch(function (error) {
  454. console.log(error);
  455. });
  456. },
  457. getProvince(){
  458. axios.post("/hotel.php/ajax/areaList", {}).then((response) => {
  459. let data = response.data;
  460. if (data.flag) {
  461. this.province = data.data;
  462. } else {
  463. this.$message.error(data.msg);
  464. }
  465. }).catch(function (error) {
  466. console.log(error);
  467. });
  468. },
  469. sizeChange(pageSize) {
  470. this.search.pageSize = pageSize;
  471. this.getData(this.search.pageNum)
  472. },
  473. edit(id){
  474. this.editPageShowUrl="/view/order_main/edit.html?id="+id;
  475. this.editShow=true;
  476. },
  477. //獲取列表
  478. getData(page) {
  479. this.search.pageNum = page;
  480. axios.post("/hotel.php/order_main/getOrderList", this.search).then((response) => {
  481. let data = response.data;
  482. if (data.flag) {
  483. this.tableData = data.data.list;
  484. this.total = data.data.total;
  485. } else {
  486. this.$message.error(response.msg);
  487. }
  488. }).catch(function (error) {
  489. console.log(error);
  490. });
  491. },
  492. }
  493. })
  494. </script>
  495. <style lang="scss" scoped>
  496. .el-table thead {
  497. background-color: #5a5e66 !important;
  498. }
  499. .header-search {
  500. font-size: 14px;
  501. font-weight: 900;
  502. }
  503. body {
  504. background-color: white;
  505. }
  506. .table {
  507. width: 100%;
  508. font-size: 12px;
  509. margin-top: 12px;
  510. background-color: white;
  511. }
  512. .el-form-item{
  513. margin-bottom: 5px !important;
  514. }
  515. </style>
  516. </html>