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

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