酒店预订平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

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