酒店预订平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

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