酒店预订平台
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.
 
 
 
 
 
 

799 lines
35 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <!-- import CSS -->
  6. <link rel="stylesheet" href="/assets/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" filterable 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" filterable 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" filterable 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" filterable 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" filterable 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. :picker-options="pickerOptions"
  76. placeholder="选择日期">
  77. </el-date-picker>
  78. ~
  79. <el-date-picker
  80. style="width: 150px;"
  81. v-model="search.endTime"
  82. value-format="yyyy-MM-dd"
  83. type="date"
  84. :picker-options="pickerOptions"
  85. placeholder="选择日期">
  86. </el-date-picker>
  87. </div>
  88. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  89. <span>金额</span>
  90. <el-input-number v-model="search.startMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  91. ~
  92. <el-input-number v-model="search.endMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  93. <span>成本</span>
  94. <el-input-number v-model="search.startCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  95. ~
  96. <el-input-number v-model="search.endCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  97. <span>利润</span>
  98. <el-input-number v-model="search.startProfit" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  99. ~
  100. <el-input-number v-model="search.endProfit" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  101. </div>
  102. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  103. <span>出游人:</span>
  104. <el-input v-model="search.customer_name" style="width: 150px;margin: 5px;" placeholder="请输入内容" clearable></el-input>
  105. <span>供应商</span>
  106. <el-select v-model="search.supplier_id" filterable style="width: 150px;margin: 5px;" placeholder="请选择" clearable>
  107. <el-option
  108. v-for="item in supplierList"
  109. :key="item.id"
  110. :label="item.name"
  111. :value="item.id">
  112. </el-option>
  113. </el-select>
  114. <span>入住时间</span>
  115. <el-date-picker
  116. style="width: 150px;margin: 5px;"
  117. v-model="search.startInDate"
  118. type="date"
  119. value-format="yyyy-MM-dd"
  120. :picker-options="pickerOptions"
  121. placeholder="选择日期">
  122. </el-date-picker>
  123. ~
  124. <el-date-picker
  125. style="width: 150px;margin: 5px;"
  126. v-model="search.endInDate"
  127. value-format="yyyy-MM-dd"
  128. type="date"
  129. :picker-options="pickerOptions"
  130. placeholder="选择日期">
  131. </el-date-picker>
  132. <span>离店时间</span>
  133. <el-date-picker
  134. style="width: 150px;margin: 5px;"
  135. v-model="search.startOutDate"
  136. type="date"
  137. value-format="yyyy-MM-dd"
  138. :picker-options="pickerOptions"
  139. placeholder="选择日期">
  140. </el-date-picker>
  141. ~
  142. <el-date-picker
  143. style="width: 150px;margin: 5px;"
  144. v-model="search.endOutDate"
  145. value-format="yyyy-MM-dd"
  146. type="date"
  147. :picker-options="pickerOptions"
  148. placeholder="选择日期">
  149. </el-date-picker>
  150. <el-button type="primary" icon="el-icon-search" style="margin: 5px;" @click="getData(1)">搜索</el-button>
  151. <el-button type="primary" icon="el-icon-plus" style="margin: 5px;" @click="addShow=true" >新增</el-button>
  152. <el-button type="primary" icon="el-icon-plus" style="margin: 5px;" v-if="isExpand == false" @click="zhankai(true)">全部展开</el-button>
  153. <el-button type="primary" icon="el-icon-minus" style="margin: 5px;" v-if="isExpand" @click="zhankai(false)">全部收起</el-button>
  154. </div>
  155. <el-table v-if="showTable" ref="multipleTable" :default-expand-all="isExpand" :data="tableData" border tooltip-effect="dark"
  156. style="font-size:12px;width: 100%;margin-top: 12px">
  157. <el-table-column width="50">
  158. <template slot-scope="scope" >
  159. <i class="el-icon-star-off" style="font-size: 18px" v-if="scope.row.hot_seq == 0" @click="setHotSeq(scope.$index,10)"></i>
  160. <i class="el-icon-star-on" style="font-size:22px;color: red" v-if="scope.row.hot_seq > 0" @click="setHotSeq(scope.$index,0)"></i>
  161. </template>
  162. </el-table-column>
  163. <el-table-column prop="id" label="订单ID" min-width="30" ></el-table-column>
  164. <el-table-column prop="commissioner" label="专员" min-width="40" ></el-table-column>
  165. <el-table-column prop="channel_order_no" label="渠道" min-width="120" >
  166. <template slot-scope="scope">
  167. <div><i class="el-icon-user" v-html="scope.row.channel_name"></i></div>
  168. <div><i class="el-icon-tickets" v-html="scope.row.channel_order_no"></i></div>
  169. </template>
  170. </el-table-column>
  171. <el-table-column prop="create_id" label="下单人" min-width="50" :formatter="getUserName"></el-table-column>
  172. <el-table-column prop="user_name" label="用户" min-width="80" >
  173. <template slot-scope="scope">
  174. <div><i class="el-icon-user-solid" v-html="scope.row.user_name"></i></div>
  175. <div><i class="el-icon-phone" v-html="scope.row.user_phone"></i></div>
  176. </template>
  177. </el-table-column>
  178. <el-table-column prop="total_amount" label="金额" min-width="80" >
  179. <template slot-scope="scope">
  180. <div v-html="'金额:'+scope.row.total_amount"></div>
  181. <div v-html="'成本:'+scope.row.cost_amount"></div>
  182. <div v-if="scope.row.profit_amount>0" v-html="'利润:'+scope.row.profit_amount"></div>
  183. <div v-if="scope.row.profit_amount<=0" v-html="'利润:'+scope.row.profit_amount" style="color: red"></div>
  184. </template>
  185. </el-table-column>
  186. <el-table-column prop="order_status" label="状态" min-width="40" :formatter="getOrderMainStatus"></el-table-column>
  187. <el-table-column prop="create_time" label="时间" min-width="100" >
  188. <template slot-scope="scope">
  189. <div ><i v-html="'下单:'+scope.row.create_time"></i></div>
  190. <div v-if="scope.row.success_time"><i v-html="'成功:'+scope.row.success_time"></i></div>
  191. <div v-if="scope.row.cancel_time"><i v-html="'取消:'+scope.row.cancel_time"></i></div>
  192. </template>
  193. </el-table-column>
  194. <el-table-column prop="receipt_order_name" label="收款单" min-width="100" >
  195. <template slot-scope="scope">
  196. <div v-if="scope.row.receipt_order_id!=0">
  197. <div v-html="'ID:'+scope.row.receipt_order_id"></div>
  198. <div v-html="'NAME:'+scope.row.receipt_order_name"></div>
  199. <div v-html="'状态:'+getReceiptOrderStatus(scope.row)" ></div>
  200. </div>
  201. </template>
  202. </el-table-column>
  203. <el-table-column label="子订单" type="expand">
  204. <template slot-scope="scope">
  205. <el-table ref="multipleTable" :data="scope.row.subOrder" border tooltip-effect="dark"
  206. style="border: 2px solid #71ebce; font-size:12px;width: 94%;margin-left: 2%;margin-right: 4%" :row-class-name="tableRowClassName">
  207. <el-table-column prop="id" label="订单ID" min-width="30" ></el-table-column>
  208. <el-table-column prop="type" label="类型" min-width="30" ></el-table-column>
  209. <el-table-column label="名称" min-width="80" >
  210. <template slot-scope="prop">
  211. <div v-if="prop.row.type=='酒店'" v-html="prop.row.hotel_name"></div>
  212. <div v-if="prop.row.type=='附加项目'" v-html="prop.row.item_name"></div>
  213. </template>
  214. </el-table-column>
  215. <el-table-column label="房型/项目类型" min-width="80" >
  216. <template slot-scope="prop">
  217. <div v-if="prop.row.type=='酒店'" v-html="prop.row.room_name"></div>
  218. <div v-if="prop.row.type=='附加项目'" v-html="getTypeName(prop.row)"></div>
  219. </template>
  220. </el-table-column>
  221. <el-table-column prop="id" label="时间" min-width="40" >
  222. <template slot-scope="prop">
  223. <div v-if="prop.row.type=='酒店'" >
  224. <div v-html="prop.row.check_in_date"></div>
  225. <div v-html="prop.row.check_out_date"></div>
  226. </div>
  227. <div v-if="prop.row.type=='附加项目'" v-html="prop.row.check_in_date"></div>
  228. </template>
  229. </el-table-column>
  230. <el-table-column prop="prod_num" label="数量" min-width="20" ></el-table-column>
  231. <el-table-column prop="customer_name" label="出游人姓名" min-width="40" ></el-table-column>
  232. <el-table-column prop="total_price" label="金额" min-width="30" ></el-table-column>
  233. <el-table-column prop="total_cost" label="成本" min-width="30" ></el-table-column>
  234. <el-table-column prop="profit" label="利润" min-width="30" >
  235. <template slot-scope="scope">
  236. <div v-if="scope.row.profit>0" v-html="scope.row.profit"></div>
  237. <div v-if="scope.row.profit<=0" v-html="scope.row.profit" style="color: red"></div>
  238. </template>
  239. </el-table-column>
  240. <el-table-column prop="supplier_name" label="供应商" min-width="30" ></el-table-column>
  241. <el-table-column label="发单状态" min-width="30" :formatter="confirmStatusName"></el-table-column>
  242. <el-table-column prop="payment_order_name" label="付款单" min-width="40" >
  243. <template slot-scope="scope">
  244. <div v-if="scope.row.payment_order_id" v-html="scope.row.payment_order_id"></div>
  245. <div v-if="scope.row.payment_order_id" v-html="scope.row.payment_order_name"></div>
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="付款单状态" min-width="40" :formatter="paymentOrderStatus" ></el-table-column>
  249. </el-table>
  250. </template>
  251. </el-table-column>
  252. <el-table-column prop="receipt_order_name" label="备注" min-width="80" >
  253. <template slot-scope="scope">
  254. <el-popover
  255. placement="top-start"
  256. title=""
  257. width="200"
  258. trigger="hover"
  259. :content="scope.row.order_memo">
  260. <div slot="reference" v-html="scope.row.order_memo" style="overflow:hidden;white-space: nowrap;"></div>
  261. </el-popover>
  262. </template>
  263. </el-table-column>
  264. <el-table-column label="操作" min-width="140">
  265. <template slot-scope="scope">
  266. <el-button-group>
  267. <el-button type="primary" size="mini" @click="edit(scope.row.id)" icon="el-icon-edit">编辑</el-button>
  268. </el-button-group>
  269. <el-button-group>
  270. <el-button type="primary" size="mini" @click="showMemoInfo(scope.row.id)" icon="el-icon-edit">备注</el-button>
  271. </el-button-group>
  272. </template>
  273. </el-table-column>
  274. </el-table>
  275. <el-pagination
  276. :page-size="search.pageSize"
  277. :pager-count="11"
  278. layout="total, sizes, prev, pager, next, jumper"
  279. :total="total"
  280. :current-page="search.pageNum"
  281. :page-sizes="[10, 20, 30, 40, 50]"
  282. @size-change="sizeChange"
  283. @current-change="getData"
  284. @prev-click="getData"
  285. @next-click="getData"
  286. ></el-pagination>
  287. </div>
  288. <transition name="bounce" v-if="addShow">
  289. <el-dialog title="新增订单" :visible.sync="addShow" width="90%" height="100%" top="15px">
  290. <iframe :src="'/view/order_main/add.html?rd='+Math.random()" frameborder="0" width="99%" id="addPageShow" onload="this.height=100"></iframe>
  291. </el-dialog>
  292. </transition>
  293. <transition name="bounce" v-if="editShow">
  294. <el-dialog title="编辑订单" :visible.sync="editShow" width="90%" height="100%" top="15px">
  295. <iframe :src="editPageShowUrl" frameborder="0" width="99%" id="editPageShow" onload="this.height=100"></iframe>
  296. </el-dialog>
  297. </transition>
  298. <transition name="bounce" v-if="showMemo">
  299. <el-dialog :title="'订单备注 : '+addMemo.order_id" :visible.sync="showMemo" width="90%" height="100%" top="15px">
  300. <div class="header-search" style="width: 90%;margin: 10px">
  301. <el-input
  302. type="textarea"
  303. :rows="2"
  304. placeholder="请输入内容"
  305. v-model="addMemo.memo">
  306. </el-input>
  307. <el-button type="primary" style="margin-top: 10px" @click="saveMemo(1)">+新增备注</el-button>
  308. </div>
  309. <el-table ref="multipleTable" :data="memoList" border tooltip-effect="dark" style="font-size:12px;width: 100%;margin: 12px">
  310. <el-table-column prop="create_time" label="时间" min-width="30" ></el-table-column>
  311. <el-table-column prop="create_name" label="用户" min-width="30" ></el-table-column>
  312. <el-table-column prop="memo" label="备注" ></el-table-column>
  313. </el-table>
  314. </el-dialog>
  315. </transition>
  316. </div>
  317. </body>
  318. <!-- import Vue before Element -->
  319. <script src="/assets/js/vue/vue.js"></script>
  320. <!-- import JavaScript -->
  321. <script src="/assets/js/vue/index.js"></script>
  322. <script src="/assets/js/axios/dist/axios.min.js"></script>
  323. <script type="text/javascript">
  324. function reinitIframe(){
  325. try{
  326. var iframe = document.getElementById("addPageShow");
  327. var bHeight = iframe.contentWindow.document.body.scrollHeight;
  328. var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
  329. var height = Math.max(bHeight, dHeight);
  330. iframe.height = height;
  331. console.log(height);
  332. }catch (ex){}
  333. try{
  334. var iframe1 = document.getElementById("editPageShow");
  335. var bHeight1 = iframe1.contentWindow.document.body.scrollHeight;
  336. var dHeight1 = iframe1.contentWindow.document.documentElement.scrollHeight;
  337. var height1 = Math.max(bHeight1, dHeight1);
  338. iframe1.height = height1;
  339. console.log(height1);
  340. }catch (ex){}
  341. }
  342. window.setInterval("reinitIframe()", 200);
  343. </script>
  344. <script>
  345. new Vue({
  346. el: '#app',
  347. data: function () {
  348. return {
  349. search: {
  350. "receipt_order_id":"",
  351. "receipt_order_status":"",
  352. "order_id":"",
  353. "channel_order_no":"",
  354. "channel_id":"",
  355. "order_status":"",
  356. "commissioner_id":"",
  357. "user_name":"",
  358. "user_phone":"",
  359. "create_id":"",
  360. "startMoney":"",
  361. "endMoney":"",
  362. "startCost":"",
  363. "endCost":"",
  364. "startProfit":"",
  365. "endProfit":"",
  366. "startTime":"",
  367. "endTime":"",
  368. "pageNum":1,
  369. "pageSize":10,
  370. "customer_name":"",
  371. "startInDate":"",
  372. "endInDate":"",
  373. "startOutDate":"",
  374. "endOutDate":""
  375. },
  376. total: 0,
  377. tableData: [],
  378. province: [],
  379. city: [],
  380. area:[],
  381. editShow:false,
  382. editPageShowUrl:"",
  383. addShow:false,
  384. //收款单状态 0:未收款 1:收款中 2已收款
  385. receiptStatus:[
  386. {id:0,name:"未收款"},
  387. {id:1,name:"收款中"},
  388. {id:2,name:"已收款"},
  389. ],
  390. //0待处理 1已确认 2部分取消 10已完成 11已取消
  391. orderMainStatus:[
  392. {id:0,name:"待处理"},
  393. {id:1,name:"已确认"},
  394. {id:2,name:"部分取消"},
  395. {id:3,name:"处理中"},
  396. {id:10,name:"已完成"},
  397. {id:11,name:"已取消"}
  398. ],
  399. userList: [],
  400. channelList:[],
  401. multipleSelection: [],
  402. confirmStatusList:[
  403. {id:1,name:"未发单"},
  404. {id:2,name:"已发单"},
  405. {id:3,name:"已确认"},
  406. {id:4,name:"已取消"}
  407. ],
  408. paymentOrderStatusList:[
  409. {"id": 0, 'value': "未付款"},
  410. {"id": 1, 'value': "付款中"},
  411. {"id": 2, 'value': "已付款"}
  412. ],
  413. type_list:[],
  414. supplierList:[],
  415. pickerOptions: {
  416. shortcuts: [{
  417. text: '今天',
  418. onClick(picker) {
  419. picker.$emit('pick', new Date());
  420. }
  421. }, {
  422. text: '昨天',
  423. onClick(picker) {
  424. const date = new Date();
  425. date.setTime(date.getTime() - 3600 * 1000 * 24);
  426. picker.$emit('pick', date);
  427. }
  428. }, {
  429. text: '一周前',
  430. onClick(picker) {
  431. const date = new Date();
  432. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  433. picker.$emit('pick', date);
  434. }
  435. }]
  436. },
  437. addMemo: {
  438. "order_id":"",
  439. "memo":""
  440. },
  441. memoList:[],
  442. showMemo:false,
  443. isExpand: false,
  444. showTable:true
  445. }
  446. },
  447. created() {
  448. window.addEventListener("message", e => {
  449. this.editShow = false
  450. this.addShow = false
  451. this.getData(1)
  452. });
  453. this.getSupplierList()
  454. this.getAdminUser();
  455. this.getChannelList();
  456. this.getProvince();
  457. this.getConfig()
  458. this.getData(1)
  459. },
  460. watch: {
  461. "search.province" : function (newVal,oldVal){
  462. this.city = []
  463. this.area = []
  464. this.search.city=""
  465. this.search.area=""
  466. if (newVal==''){
  467. return false;
  468. }
  469. let row = {
  470. "province":newVal
  471. }
  472. axios.post("/hotel.php/ajax/areaList", row).then((response) => {
  473. let data = response.data;
  474. if (data.flag) {
  475. this.city = data.data;
  476. } else {
  477. this.$message({
  478. offset:0,
  479. showClose:true,duration:500,
  480. type: 'error',
  481. message: data.msg
  482. });
  483. }
  484. }).catch(function (error) {
  485. console.log(error);
  486. });
  487. },
  488. "search.city" : function (newVal,oldVal){
  489. this.area = []
  490. this.search.area=""
  491. if (newVal == "") {
  492. return false;
  493. }
  494. let row = {
  495. province:this.search.province,
  496. city:newVal
  497. }
  498. axios.post("/hotel.php/ajax/areaList", row).then((response) => {
  499. let data = response.data;
  500. if (data.flag) {
  501. this.area = data.data;
  502. } else {
  503. this.$message({
  504. offset:0,
  505. showClose:true,duration:500,
  506. type: 'error',
  507. message: data.msg
  508. });
  509. }
  510. }).catch(function (error) {
  511. console.log(error);
  512. });
  513. },
  514. },
  515. methods: {
  516. zhankai(val){
  517. this.isExpand = val;
  518. this.showTable = false;
  519. setTimeout(e => {
  520. this.showTable = true;
  521. // this.showTable(true)
  522. }, 500); // 定时时间
  523. },
  524. getSupplierList(){
  525. axios.post("/hotel.php/cf_suplier_info/getList", this.search).then((response) => {
  526. console.log(response)
  527. let data = response.data;
  528. this.supplierList = data.list;
  529. }).catch(function (error) {
  530. console.log(error);
  531. });
  532. },
  533. getTypeName(info) {
  534. for (let i = 0; i < this.type_list.length; i++) {
  535. if (this.type_list[i].id == info.item_type) {
  536. return this.type_list[i].name
  537. }
  538. }
  539. return ""
  540. },
  541. getConfig(){
  542. axios.post("/hotel.php/general/config/getList?key=site.item_category", {}).then((response) => {
  543. let data = response.data;
  544. this.type_list = data.list;
  545. }).catch(function (error) {
  546. console.log(error);
  547. });
  548. },
  549. paymentOrderStatus(info){
  550. if (info.payment_order_id ==0) {
  551. return "-"
  552. }
  553. for (let i = 0; i < this.paymentOrderStatusList.length; i++) {
  554. if (this.paymentOrderStatusList[i].id == info.payment_order_status) {
  555. return this.paymentOrderStatusList[i].value
  556. }
  557. }
  558. return "-"
  559. },
  560. confirmStatusName(info){
  561. for (let i = 0; i < this.confirmStatusList.length; i++) {
  562. if (this.confirmStatusList[i].id == info.confirm_status) {
  563. return this.confirmStatusList[i].name
  564. }
  565. }
  566. return "-"
  567. },
  568. getReceiptOrderStatus(info){
  569. for (let i = 0; i < this.receiptStatus.length; i++) {
  570. if (this.receiptStatus[i].id == info.receipt_order_status) {
  571. return this.receiptStatus[i].name
  572. }
  573. }
  574. return "-"
  575. },
  576. getChannelList(){
  577. axios.post("/hotel.php/cf_channel_info/getList", this.search).then((response) => {
  578. console.log(response)
  579. let data = response.data;
  580. this.channelList = data.list;
  581. }).catch(function (error) {
  582. console.log(error);
  583. });
  584. },
  585. getUserName(info) {
  586. for (let i = 0; i < this.userList.length; i++) {
  587. if (this.userList[i].id == info.create_id) {
  588. return this.userList[i].name
  589. }
  590. }
  591. return "-"
  592. },
  593. getOrderMainStatus(info){
  594. for (let i = 0; i < this.orderMainStatus.length; i++) {
  595. if (this.orderMainStatus[i].id == info.order_status) {
  596. return this.orderMainStatus[i].name
  597. }
  598. }
  599. return "-"
  600. },
  601. getAdminUser() {
  602. axios.post("/hotel.php/auth/admin/getList", this.search).then((response) => {
  603. this.userList = response.data.list;
  604. }).catch(function (error) {
  605. console.log(error);
  606. });
  607. },
  608. getProvince(){
  609. axios.post("/hotel.php/ajax/areaList", {}).then((response) => {
  610. let data = response.data;
  611. if (data.flag) {
  612. this.province = data.data;
  613. } else {
  614. this.$message({
  615. offset:0,
  616. showClose:true,duration:500,
  617. type: 'error',
  618. message: data.msg
  619. });
  620. }
  621. }).catch(function (error) {
  622. console.log(error);
  623. });
  624. },
  625. sizeChange(pageSize) {
  626. this.search.pageSize = pageSize;
  627. this.getData(this.search.pageNum)
  628. },
  629. edit(id){
  630. this.editPageShowUrl="/view/order_main/edit.html?id="+id+"&rd="+Math.random();
  631. this.editShow=true;
  632. },
  633. //獲取列表
  634. getData(page) {
  635. this.search.pageNum = page;
  636. axios.post("/hotel.php/order_main/getOrderList", this.search).then((response) => {
  637. let data = response.data;
  638. if (data.flag) {
  639. this.tableData = data.data.list;
  640. this.total = data.data.total;
  641. } else {
  642. this.$message({
  643. offset:0,
  644. showClose:true,duration:500,
  645. type: 'error',
  646. message: data.msg
  647. });
  648. }
  649. }).catch(function (error) {
  650. console.log(error);
  651. });
  652. },
  653. //獲取列表
  654. saveMemo() {
  655. if (this.addMemo.memo == "") {
  656. this.$message({
  657. offset:0,
  658. showClose:true,duration:500,
  659. type: 'error',
  660. message: "请输入备注内容"
  661. });
  662. return false;
  663. }
  664. axios.post("/hotel.php/order_main/addMemo", this.addMemo).then((response) => {
  665. let data = response.data;
  666. if (data.flag) {
  667. this.$message({
  668. offset:0,
  669. showClose:true,duration:500,
  670. type: 'success',
  671. message: "添加成功"
  672. });
  673. this.getMemoList()
  674. this.getData(this.search.pageNum)
  675. } else {
  676. this.$message({
  677. offset:0,
  678. showClose:true,duration:500,
  679. type: 'error',
  680. message: data.msg
  681. });
  682. }
  683. }).catch(function (error) {
  684. console.log(error);
  685. });
  686. },
  687. //獲取列表
  688. getMemoList() {
  689. let param = {
  690. pageNum:1,
  691. pageSize:1000,
  692. order_id:this.addMemo.order_id
  693. }
  694. axios.post("/hotel.php/order_main/getMemoList", param).then((response) => {
  695. let data = response.data;
  696. if (data.flag) {
  697. this.memoList = data.data.list;
  698. } else {
  699. this.$message({
  700. offset:0,
  701. showClose:true,duration:500,
  702. type: 'error',
  703. message: data.msg
  704. });
  705. }
  706. }).catch(function (error) {
  707. console.log(error);
  708. });
  709. },
  710. showMemoInfo(order_id){
  711. this.memoList = [];
  712. this.showMemo = true
  713. this.addMemo.order_id = order_id;
  714. this.getMemoList();
  715. },
  716. setHotSeq(index,val){
  717. let info = this.tableData[index]
  718. let param = {
  719. order_id:info["id"],
  720. val:val
  721. }
  722. axios.post("/hotel.php/order_main/setHotFlag", param).then((response) => {
  723. let data = response.data;
  724. if (data.flag) {
  725. this.tableData[index].hot_seq=val
  726. this.$message({
  727. offset:0,
  728. showClose:true,duration:500,
  729. type: 'success',
  730. message: "设置成功"
  731. });
  732. this.getData(this.search.pageNum)
  733. } else {
  734. this.$message({
  735. offset:0,
  736. showClose:true,duration:500,
  737. type: 'error',
  738. message: data.msg
  739. });
  740. }
  741. }).catch(function (error) {
  742. console.log(error);
  743. });
  744. },
  745. tableRowClassName({row, rowIndex}){
  746. return 'success-row';
  747. }
  748. }
  749. })
  750. </script>
  751. <style lang="scss" scoped>
  752. .el-table .success-row {
  753. background: #f9ebeb;
  754. }
  755. /*修改展开按钮的样式 start*/
  756. /*1.取消原本展开的旋转动效*/
  757. .el-table__expand-icon{
  758. -webkit-transform: rotate(0deg);
  759. transform: rotate(0deg);
  760. }
  761. /*2.展开按钮未点击的样式是加号带边框*/
  762. .el-table__expand-icon .el-icon-arrow-right:before{
  763. content: "\e6d9";
  764. border: 1px solid #ccc;
  765. padding: 2px;
  766. }
  767. /*3.展开按钮点击后的样式是减号带边框*/
  768. .el-table__expand-icon--expanded .el-icon-arrow-right:before{
  769. content: "\e6d8";
  770. }
  771. /*修改展开按钮的样式 end*/
  772. .el-table thead {
  773. background-color: #5a5e66 !important;
  774. }
  775. .header-search {
  776. font-size: 14px;
  777. font-weight: 900;
  778. }
  779. body {
  780. background-color: white;
  781. }
  782. .table {
  783. width: 100%;
  784. font-size: 12px;
  785. margin-top: 12px;
  786. background-color: white;
  787. }
  788. .el-form-item{
  789. margin-bottom: 5px !important;
  790. }
  791. </style>
  792. </html>