酒店预订平台
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

426 wiersze
18 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. </template>
  116. </el-table-column>
  117. <el-table-column prop="order_status" label="状态" min-width="40" :formatter="getOrderMainStatus"></el-table-column>
  118. <el-table-column prop="create_time" label="下单时间" min-width="80" ></el-table-column>
  119. <el-table-column prop="create_time" label="结束时间" min-width="90" >
  120. <template slot-scope="scope">
  121. <div v-if="scope.row.success_time"><i class="el-icon-success" v-html="scope.row.success_time"></i></div>
  122. <div v-if="scope.row.cancel_time"><i class="el-icon-delete-solid" v-html="scope.row.cancel_time"></i></div>
  123. </template>
  124. </el-table-column>
  125. <el-table-column prop="receipt_order_name" label="收款单" min-width="80" >
  126. <template slot-scope="scope">
  127. <div v-if="scope.row.receipt_order_id!=0">
  128. <div v-html="scope.row.receipt_order_id"></div>
  129. <div v-html="scope.row.receipt_order_name"></div>
  130. </div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column prop="receipt_order_status" label="收款单状态" min-width="50" :formatter="getReceiptOrderStatus">
  134. <template slot-scope="scope">
  135. <div v-if="scope.row.receipt_order_id!=0" >
  136. <div v-html="getReceiptOrderStatus(scope.row)" ></div>
  137. </div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column prop="receipt_order_name" label="备注" min-width="80" >
  141. <template slot-scope="scope">
  142. <el-popover
  143. placement="top-start"
  144. title=""
  145. width="200"
  146. trigger="hover"
  147. :content="scope.row.order_memo">
  148. <div slot="reference" v-html="scope.row.order_memo" style="overflow:hidden;white-space: nowrap;"></div>
  149. </el-popover>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="操作" min-width="70">
  153. <template slot-scope="scope">
  154. <el-button-group>
  155. <el-button type="primary" size="mini" @click="edit(scope.row.id)" icon="el-icon-edit">编辑</el-button>
  156. </el-button-group>
  157. </template>
  158. </el-table-column>
  159. </el-table>
  160. <el-pagination
  161. :page-size="search.pageSize"
  162. :pager-count="11"
  163. layout="total, sizes, prev, pager, next, jumper"
  164. :total="total"
  165. :current-page="search.pageNum"
  166. :page-sizes="[10, 20, 30, 40, 50]"
  167. @size-change="sizeChange"
  168. @current-change="getData"
  169. @prev-click="getData"
  170. @next-click="getData"
  171. ></el-pagination>
  172. </div>
  173. <transition name="bounce" v-if="addShow">
  174. <el-dialog title="新增订单" :visible.sync="addShow" width="90%" height="100%" top="15px">
  175. <iframe src="/view/order_main/add.html" frameborder="0" width="99%" id="addPageShow" onload="this.height=100"></iframe>
  176. </el-dialog>
  177. </transition>
  178. <transition name="bounce" v-if="editShow">
  179. <el-dialog title="编辑订单" :visible.sync="editShow" width="90%" height="100%" top="15px">
  180. <iframe :src="editPageShowUrl" frameborder="0" width="99%" id="editPageShow" onload="this.height=100"></iframe>
  181. </el-dialog>
  182. </transition>
  183. </div>
  184. </body>
  185. <!-- import Vue before Element -->
  186. <script src="/assets/js/vue/vue.js"></script>
  187. <!-- import JavaScript -->
  188. <script src="/assets/js/vue/index.js"></script>
  189. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  190. <script type="text/javascript">
  191. function reinitIframe(){
  192. try{
  193. var iframe = document.getElementById("addPageShow");
  194. var bHeight = iframe.contentWindow.document.body.scrollHeight;
  195. var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
  196. var height = Math.max(bHeight, dHeight);
  197. iframe.height = height;
  198. console.log(height);
  199. }catch (ex){}
  200. try{
  201. var iframe1 = document.getElementById("editPageShow");
  202. var bHeight1 = iframe1.contentWindow.document.body.scrollHeight;
  203. var dHeight1 = iframe1.contentWindow.document.documentElement.scrollHeight;
  204. var height1 = Math.max(bHeight1, dHeight1);
  205. iframe1.height = height1;
  206. console.log(height1);
  207. }catch (ex){}
  208. }
  209. window.setInterval("reinitIframe()", 200);
  210. </script>
  211. <script>
  212. new Vue({
  213. el: '#app',
  214. data: function () {
  215. return {
  216. search: {
  217. "receipt_order_id":"",
  218. "receipt_order_status":"",
  219. "order_id":"",
  220. "channel_order_no":"",
  221. "channel_id":"",
  222. "order_status":"",
  223. "commissioner_id":"",
  224. "user_name":"",
  225. "user_phone":"",
  226. "create_id":"",
  227. "startMoney":"",
  228. "endMoney":"",
  229. "startTime":"",
  230. "endTime":"",
  231. "pageNum":1,
  232. "pageSize":10
  233. },
  234. total: 0,
  235. tableData: [],
  236. province: [],
  237. city: [],
  238. area:[],
  239. editShow:false,
  240. editPageShowUrl:"",
  241. addShow:false,
  242. //收款单状态 0:未收款 1:收款中 2已收款
  243. receiptStatus:[
  244. {id:0,name:"未收款"},
  245. {id:1,name:"收款中"},
  246. {id:2,name:"已收款"},
  247. ],
  248. //0待处理 1已确认 2部分取消 10已完成 11已取消
  249. orderMainStatus:[
  250. {id:0,name:"待处理"},
  251. {id:1,name:"已确认"},
  252. {id:2,name:"部分取消"},
  253. {id:3,name:"处理中"},
  254. {id:10,name:"已完成"},
  255. {id:11,name:"已取消"}
  256. ],
  257. userList: [],
  258. channelList:[],
  259. multipleSelection: []
  260. }
  261. },
  262. created() {
  263. window.addEventListener("message", e => {
  264. this.editShow = false
  265. this.addShow = false
  266. this.getData(1)
  267. });
  268. this.getAdminUser();
  269. this.getChannelList();
  270. this.getProvince();
  271. this.getData(1)
  272. },
  273. watch: {
  274. "search.province" : function (newVal,oldVal){
  275. this.city = []
  276. this.area = []
  277. this.search.city=""
  278. this.search.area=""
  279. if (newVal==''){
  280. return false;
  281. }
  282. let row = {
  283. "province":newVal
  284. }
  285. axios.post("/hotel.php/ajax/areaList", row).then((response) => {
  286. let data = response.data;
  287. if (data.flag) {
  288. this.city = data.data;
  289. } else {
  290. this.$message.error(data.msg);
  291. }
  292. }).catch(function (error) {
  293. console.log(error);
  294. });
  295. },
  296. "search.city" : function (newVal,oldVal){
  297. this.area = []
  298. this.search.area=""
  299. if (newVal == "") {
  300. return false;
  301. }
  302. let row = {
  303. province:this.search.province,
  304. city:newVal
  305. }
  306. axios.post("/hotel.php/ajax/areaList", row).then((response) => {
  307. let data = response.data;
  308. if (data.flag) {
  309. this.area = data.data;
  310. } else {
  311. this.$message.error(data.msg);
  312. }
  313. }).catch(function (error) {
  314. console.log(error);
  315. });
  316. },
  317. },
  318. methods: {
  319. getReceiptOrderStatus(info){
  320. for (let i = 0; i < this.receiptStatus.length; i++) {
  321. if (this.receiptStatus[i].id == info.receipt_order_status) {
  322. return this.receiptStatus[i].name
  323. }
  324. }
  325. return "-"
  326. },
  327. getChannelList(){
  328. axios.post("/hotel.php/cf_channel_info/getList", this.search).then((response) => {
  329. console.log(response)
  330. let data = response.data;
  331. this.channelList = data.list;
  332. }).catch(function (error) {
  333. console.log(error);
  334. });
  335. },
  336. getUserName(info) {
  337. for (let i = 0; i < this.userList.length; i++) {
  338. if (this.userList[i].id == info.create_id) {
  339. return this.userList[i].name
  340. }
  341. }
  342. return "-"
  343. },
  344. getOrderMainStatus(info){
  345. for (let i = 0; i < this.orderMainStatus.length; i++) {
  346. if (this.orderMainStatus[i].id == info.order_status) {
  347. return this.orderMainStatus[i].name
  348. }
  349. }
  350. return "-"
  351. },
  352. getAdminUser() {
  353. axios.post("/hotel.php/auth/admin/getList", this.search).then((response) => {
  354. this.userList = response.data.list;
  355. }).catch(function (error) {
  356. console.log(error);
  357. });
  358. },
  359. getProvince(){
  360. axios.post("/hotel.php/ajax/areaList", {}).then((response) => {
  361. let data = response.data;
  362. if (data.flag) {
  363. this.province = data.data;
  364. } else {
  365. this.$message.error(data.msg);
  366. }
  367. }).catch(function (error) {
  368. console.log(error);
  369. });
  370. },
  371. sizeChange(pageSize) {
  372. this.search.pageSize = pageSize;
  373. this.getData(this.search.pageNum)
  374. },
  375. edit(id){
  376. this.editPageShowUrl="/view/order_main/edit.html?id="+id;
  377. this.editShow=true;
  378. },
  379. //獲取列表
  380. getData(page) {
  381. this.search.pageNum = page;
  382. axios.post("/hotel.php/order_main/getOrderList", this.search).then((response) => {
  383. let data = response.data;
  384. if (data.flag) {
  385. this.tableData = data.data.list;
  386. this.total = data.data.total;
  387. } else {
  388. this.$message.error(response.msg);
  389. }
  390. }).catch(function (error) {
  391. console.log(error);
  392. });
  393. },
  394. }
  395. })
  396. </script>
  397. <style lang="scss" scoped>
  398. .el-table thead {
  399. background-color: #5a5e66 !important;
  400. }
  401. .header-search {
  402. font-size: 14px;
  403. font-weight: 900;
  404. }
  405. body {
  406. background-color: white;
  407. }
  408. .table {
  409. width: 100%;
  410. font-size: 12px;
  411. margin-top: 12px;
  412. background-color: white;
  413. }
  414. .el-form-item{
  415. margin-bottom: 5px !important;
  416. }
  417. </style>
  418. </html>