酒店预订平台
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

736 líneas
33 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.id" style="width: 120px;" placeholder="请输入内容" clearable></el-input>
  14. <span>名称:</span>
  15. <el-input v-model="search.name" style="width: 120px;" placeholder="请输入内容" clearable></el-input>
  16. <span>状态</span>
  17. <el-select v-model="search.status" filterable placeholder="请选择" clearable>
  18. <el-option
  19. v-for="item in status"
  20. :key="item.id"
  21. :label="item.value"
  22. :value="item.id">
  23. </el-option>
  24. </el-select>
  25. <span>创建人</span>
  26. <el-select v-model="search.create_id" filterable placeholder="请选择" clearable>
  27. <el-option
  28. v-for="item in userList"
  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-number v-model="search.startCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  38. ~
  39. <el-input-number v-model="search.endCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  40. <el-button type="primary" icon="el-icon-search" @click="getData(1)">搜索</el-button>
  41. <el-button type="primary" icon="el-icon-plus" @click="edit(null)">新增付款单</el-button>
  42. </div>
  43. <el-table ref="multipleTable" :data="tableData" border tooltip-effect="dark"
  44. style="font-size:12px;width: 100%;margin-top: 12px">
  45. <el-table-column prop="create_id" label="创建人" min-width="70" :formatter="getUserName"></el-table-column>
  46. <el-table-column prop="id" label="付款单号" min-width="50"></el-table-column>
  47. <el-table-column prop="name" label="付款单名称" min-width="120"></el-table-column>
  48. <el-table-column prop="status" label="付款单状态" :formatter="getStatusName" min-width="150">
  49. <template slot-scope="scope">
  50. <el-radio-group v-model="scope.row.status" size="mini" @change="setStatus(scope.row)">
  51. <el-radio-button label="0">未付款</el-radio-button>
  52. <el-radio-button label="1">付款中</el-radio-button>
  53. <el-radio-button label="2">已付款</el-radio-button>
  54. </el-radio-group>
  55. </template>
  56. </el-table-column>
  57. <el-table-column prop="order_ids" label="酒店" min-width="130">
  58. <template slot-scope="scope">
  59. <div v-html="scope.row.hotel"></div>
  60. </template>
  61. </el-table-column>
  62. <el-table-column prop="total_amount" label="附加项目" min-width="130">
  63. <template slot-scope="scope">
  64. <div v-html="scope.row.item"></div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column prop="create_time" label="创建时间" min-width="80"></el-table-column>
  68. <el-table-column prop="update_time" label="更新时间" min-width="80"></el-table-column>
  69. <el-table-column label="操作" min-width="180">
  70. <template slot-scope="scope">
  71. <el-button-group>
  72. <el-button type="primary" size="mini" @click="edit(scope.row)" icon="el-icon-edit">编辑</el-button>
  73. <el-button type="success" size="mini" @click="editOrderDivShow(scope.row)" icon="el-icon-share">订单</el-button>
  74. <el-button type="danger" size="mini" icon="el-icon-delete" @click="delAll(scope.row.id)">删除</el-button>
  75. </el-button-group>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <el-pagination
  80. :page-size="search.pageSize"
  81. :pager-count="11"
  82. layout="total, sizes, prev, pager, next, jumper"
  83. :total="total"
  84. :current-page="search.pageNum"
  85. :page-sizes="[10, 20, 30, 40, 50]"
  86. @size-change="sizeChange"
  87. @current-change="getData"
  88. @prev-click="getData"
  89. @next-click="getData"
  90. ></el-pagination>
  91. </div>
  92. <transition name="bounce" v-if="editShow">
  93. <el-dialog title="付款单详情" :visible.sync="editShow" width="90%" top="15px">
  94. <el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 20px">
  95. <div style="display: flex;width: 100%">
  96. <el-form-item v-if="editType" label="付款单ID:" style="width: 80%">
  97. <div v-html="editData.id"></div>
  98. </el-form-item>
  99. </div>
  100. <div>
  101. <el-form-item label="付款单名称:" style="width: 80%">
  102. <el-input v-model="editData.name" style="width: 120px;" placeholder="请输入内容"></el-input>
  103. </el-form-item>
  104. </div>
  105. <div>
  106. <el-form-item v-if="editType" label="付款单状态:" style="width: 80%">
  107. <el-radio-group v-model="editData.status" size="mini" disabled>
  108. <el-radio-button label="0">未付款</el-radio-button>
  109. <el-radio-button label="1">付款中</el-radio-button>
  110. <el-radio-button label="2">已付款</el-radio-button>
  111. </el-radio-group>
  112. </el-form-item>
  113. </div>
  114. <div>
  115. <el-button type="primary" @click="editDoing()" >保存</el-button>
  116. </div>
  117. </el-form>
  118. </el-dialog>
  119. </transition>
  120. <transition name="bounce" v-if="editOrderShow">
  121. <el-dialog title="详情" :visible.sync="editOrderShow" width="100%" top="15px">
  122. <el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 10px">
  123. <div style="display: flex;width: 100%">
  124. <el-form-item label="付款单ID:" style="width: 80%">
  125. <div v-html="editOrder.id"></div>
  126. </el-form-item>
  127. <el-form-item label="付款单名称:" style="width: 80%">
  128. <div v-html="editOrder.name"></div>
  129. </el-form-item>
  130. <el-form-item label="付款单状态:" style="width: 80%">
  131. <el-radio-group v-model="editOrder.status" size="mini" disabled>
  132. <el-radio-button label="0">未付款</el-radio-button>
  133. <el-radio-button label="1">付款中</el-radio-button>
  134. <el-radio-button label="2">已付款</el-radio-button>
  135. </el-radio-group>
  136. </el-form-item>
  137. </div>
  138. </el-form>
  139. <div>
  140. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  141. <span>主订单ID:</span>
  142. <el-input v-model="orderMainListSearch.order_id" style="width: 120px;" placeholder="请输入内容"></el-input>
  143. <span>子订单ID:</span>
  144. <el-input v-model="orderMainListSearch.sub_order_id" style="width: 120px;" placeholder="请输入内容"></el-input>
  145. <span>订单类型:</span>
  146. <el-select v-model="orderMainListSearch.prod_type" filterable style="width: 120px;" placeholder="请选择" >
  147. <el-option
  148. v-for="item in prodTypeList"
  149. :key="item.id"
  150. :label="item.name"
  151. :value="item.id">
  152. </el-option>
  153. </el-select>
  154. <span>用户名</span>
  155. <el-input v-model="orderMainListSearch.customer_name" style="width: 120px;" placeholder="请输入内容" clearable></el-input>
  156. </div>
  157. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  158. <span>附加项目</span>
  159. <el-select v-model="orderMainListSearch.item_id" filterable style="width: 120px;" placeholder="请选择" clearable>
  160. <el-option
  161. v-for="item in itemList"
  162. :key="item.id"
  163. :label="item.name"
  164. :value="item.id">
  165. </el-option>
  166. </el-select>
  167. <span>酒店</span>
  168. <el-select v-model="orderMainListSearch.hotel_id" filterable style="width: 120px;" placeholder="请选择" clearable>
  169. <el-option
  170. v-for="item in hotelList"
  171. :key="item.id"
  172. :label="item.name"
  173. :value="item.id">
  174. </el-option>
  175. </el-select>
  176. <span>确认单状态:</span>
  177. <el-select v-model="orderMainListSearch.confirm_status" filterable style="width: 120px;" placeholder="请选择" clearable>
  178. <el-option
  179. v-for="item in confirmStatusList"
  180. :key="item.id"
  181. :label="item.name"
  182. :value="item.id">
  183. </el-option>
  184. </el-select>
  185. <span>付款单状态</span>
  186. <el-select v-model="orderMainListSearch.inPayment" filterable style="width: 120px;" placeholder="请选择" clearable>
  187. <el-option
  188. v-for="item in inPaymentList"
  189. :key="item.id"
  190. :label="item.name"
  191. :value="item.id">
  192. </el-option>
  193. </el-select>
  194. <span>供应商:</span>
  195. <el-select v-model="orderMainListSearch.supplier_id" filterable style="width: 120px;" placeholder="请选择" clearable>
  196. <el-option
  197. v-for="item in supplierList"
  198. :key="item.id"
  199. :label="item.name"
  200. :value="item.id">
  201. </el-option>
  202. </el-select>
  203. </div>
  204. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  205. <span>成本</span>
  206. <el-input-number v-model="orderMainListSearch.startMoney" style="width: 180px;" placeholder="请输入内容" clearable></el-input-number>
  207. ~
  208. <el-input-number v-model="orderMainListSearch.endMoney" style="width: 180px;" placeholder="请输入内容" clearable></el-input-number>
  209. <span>时间</span>
  210. <el-date-picker
  211. style="width: 180px;"
  212. v-model="orderMainListSearch.startTime"
  213. type="date"
  214. value-format="yyyy-MM-dd"
  215. :picker-options="pickerOptions"
  216. placeholder="选择日期">
  217. </el-date-picker>
  218. ~
  219. <el-date-picker
  220. style="width: 180px;"
  221. v-model="orderMainListSearch.endTime"
  222. value-format="yyyy-MM-dd"
  223. type="date"
  224. :picker-options="pickerOptions"
  225. placeholder="选择日期">
  226. </el-date-picker>
  227. <el-button type="primary" icon="el-icon-search" @click="getOrderMainData(1)">搜索</el-button>
  228. </div>
  229. <div>
  230. <el-table ref="multipleTable" :data="orderMainList" border tooltip-effect="dark" style="font-size:12px;width: 100%;margin-top: 12px" @selection-change="handleSelectionChange">
  231. <el-table-column type="selection" width="30" :selectable="checkSelect"></el-table-column>
  232. <el-table-column prop="order_id" label="主订单ID" min-width="20" ></el-table-column>
  233. <el-table-column prop="id" label="子订单ID" min-width="20" ></el-table-column>
  234. <el-table-column label="订单类型" min-width="30" :formatter="getProdTypeName" ></el-table-column>
  235. <el-table-column prop="supplier_name" label="供应商" min-width="40" ></el-table-column>
  236. <el-table-column prop="trade_order_number" label="第三方订单号" min-width="40" ></el-table-column>
  237. <el-table-column prop="hotel_name" label="酒店/项目类型" min-width="80" :formatter="getTypeName"></el-table-column>
  238. <el-table-column prop="room_name" label="房型/附加项目" min-width="80" ></el-table-column>
  239. <el-table-column prop="plan_name" label="价格方案/计价单位" min-width="40" ></el-table-column>
  240. <el-table-column prop="check_in_date" label="时间" min-width="40" >
  241. <template slot-scope="scope">
  242. <div v-html="scope.row.check_in_date"></div>
  243. <div v-html="scope.row.check_out_date"></div>
  244. </template>
  245. </el-table-column>
  246. <el-table-column prop="count" label="数量" min-width="20" ></el-table-column>
  247. <el-table-column prop="customer_name" label="出游人姓名" min-width="40" ></el-table-column>
  248. <el-table-column prop="total_cost" label="总成本" min-width="30" ></el-table-column>
  249. <el-table-column label="发单状态" min-width="30" :formatter="confirmStatusName"></el-table-column>
  250. <el-table-column prop="create_time" label="子订单生成时间" min-width="60" ></el-table-column>
  251. <el-table-column prop="payment_order_name" label="付款单" min-width="40" >
  252. <template slot-scope="scope">
  253. <div v-html="scope.row.payment_order_id"></div>
  254. <div v-html="scope.row.payment_order_name"></div>
  255. </template>
  256. </el-table-column>
  257. <el-table-column label="操作" >
  258. <template slot-scope="scope">
  259. <el-button-group>
  260. <el-button type="primary" size="mini" v-if="scope.row.payment_order_id==0 && editOrder.status==0" @click="addOrderInfo(scope.row)" icon="el-icon-edit">添加</el-button>
  261. <el-button type="danger" size="mini" v-if="scope.row.payment_order_id==editOrder.id && editOrder.status==0" @click="removeOrderMain(scope.row)" icon="el-icon-delete">移除</el-button>
  262. </el-button-group>
  263. </template>
  264. </el-table-column>
  265. </el-table>
  266. <div style="margin-top: 5px">
  267. <el-button type="primary" icon="el-icon-circle-plus" @click="addOrderAll()" :disabled="multipleSelection.length==0">添加到采购单</el-button>
  268. </div>
  269. <el-pagination
  270. :page-size="orderMainListSearch.pageSize"
  271. :pager-count="11"
  272. layout="total, sizes, prev, pager, next, jumper"
  273. :total="orderMainTotal"
  274. :current-page="orderMainListSearch.pageNum"
  275. :page-sizes="[10, 20, 30, 40, 50]"
  276. @size-change="sizeOrderMainChange"
  277. @current-change="getOrderMainData"
  278. @prev-click="getOrderMainData"
  279. @next-click="getOrderMainData"
  280. ></el-pagination>
  281. </div>
  282. </div>
  283. </el-dialog>
  284. </transition>
  285. </div>
  286. </body>
  287. <!-- import Vue before Element -->
  288. <script src="/assets/js/vue/vue.js"></script>
  289. <!-- import JavaScript -->
  290. <script src="/assets/js/vue/index.js"></script>
  291. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  292. <script>
  293. new Vue({
  294. el: '#app',
  295. data: function () {
  296. return {
  297. search: {
  298. id:"",
  299. create_id:"",
  300. name: "",
  301. status: "all",
  302. startCost:"",
  303. endCost:"",
  304. pageSize: 10,
  305. pageNum: 1
  306. },
  307. status: [
  308. {"id": "all", "value": "请选择"},
  309. {"id": 0, 'value': "未付款"},
  310. {"id": 1, 'value': "付款中"},
  311. {"id": 2, 'value': "已付款"}
  312. ],
  313. total: 0,
  314. tableData: [],
  315. userList: [],
  316. info: {
  317. id: null,
  318. name: "",
  319. status: 0,
  320. list: []
  321. },
  322. editShow: false,
  323. editType: false,
  324. editData: {},
  325. editOrderShow:false,
  326. editOrder:{},
  327. orderMainListSearch:{
  328. "payment_order_id":"",
  329. "order_id":"",
  330. "sub_order_id":"",
  331. "prod_type":"hotel",
  332. "supplier_id":"",
  333. "inPayment":"",
  334. "confirm_status":"",
  335. "customer_name":"",
  336. "startMoney":"",
  337. "endMoney":"",
  338. "startTime":"",
  339. "endTime":"",
  340. "pageNum":1,
  341. "pageSize":10,
  342. "item_id":"",
  343. "hotel_id":"",
  344. "room_id":"",
  345. "plan_id":""
  346. },
  347. orderMainTotal:0,
  348. orderMainList:[],
  349. inPaymentList:[
  350. {id:1,name:"在此付款单中"},
  351. {id:2,name:"不在此付款单中"},
  352. {id:3,name:"不在任何付款单中"}
  353. ],
  354. //1、未发单/ 2已发单、3已确认、4已取消
  355. confirmStatusList:[
  356. {id:1,name:"未发单"},
  357. {id:2,name:"已发单"},
  358. {id:3,name:"已确认"},
  359. {id:4,name:"已取消"}
  360. ],
  361. prodTypeList:[
  362. {id:"hotel",name:"酒店"},
  363. {id:"item",name:"附加项目"}
  364. ],
  365. supplierList:[],
  366. multipleSelection: [],
  367. hotelList:[],
  368. itemList:[],
  369. type_list:[],
  370. pickerOptions: {
  371. shortcuts: [{
  372. text: '今天',
  373. onClick(picker) {
  374. picker.$emit('pick', new Date());
  375. }
  376. }, {
  377. text: '昨天',
  378. onClick(picker) {
  379. const date = new Date();
  380. date.setTime(date.getTime() - 3600 * 1000 * 24);
  381. picker.$emit('pick', date);
  382. }
  383. }, {
  384. text: '一周前',
  385. onClick(picker) {
  386. const date = new Date();
  387. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  388. picker.$emit('pick', date);
  389. }
  390. }]
  391. },
  392. }
  393. },
  394. created() {
  395. this.getAdminUser();
  396. this.getSupplierList();
  397. this.getData(1)
  398. this.getHotelList()
  399. this.getConfig()
  400. this.getItemList()
  401. },
  402. watch: {
  403. "orderMainListSearch.prod_type" : function (newVal,oldVal){
  404. this.getOrderMainData(1)
  405. }
  406. },
  407. methods: {
  408. getTypeName(info) {
  409. for (let i = 0; i < this.type_list.length; i++) {
  410. if (this.type_list[i].id == info.hotel_name) {
  411. return this.type_list[i].name
  412. }
  413. }
  414. return info.hotel_name
  415. },
  416. getConfig(){
  417. axios.post("/hotel.php/general/config/getList?key=site.item_category", {}).then((response) => {
  418. let data = response.data;
  419. this.type_list = data.list;
  420. }).catch(function (error) {
  421. console.log(error);
  422. });
  423. },
  424. getProdTypeName(info){
  425. for (let i = 0; i < this.prodTypeList.length; i++) {
  426. if (this.prodTypeList[i].id == info.prod_type) {
  427. return this.prodTypeList[i].name
  428. }
  429. }
  430. return "-"
  431. },
  432. getHotelList(){
  433. axios.post("/hotel.php/cf_hotel_info/getHotelList", this.search).then((response) => {
  434. console.log(response)
  435. let data = response.data;
  436. this.hotelList = data.list;
  437. }).catch(function (error) {
  438. console.log(error);
  439. });
  440. },
  441. getItemList(){
  442. axios.post("/hotel.php/cf_item/getList", this.search).then((response) => {
  443. console.log(response)
  444. let data = response.data;
  445. this.itemList = data.list;
  446. }).catch(function (error) {
  447. console.log(error);
  448. });
  449. },
  450. checkSelect(row,index){
  451. if (this.editOrder.status != 0) {
  452. return false;
  453. }
  454. if (row.payment_order_id ==0) {
  455. return true;
  456. }
  457. return false;
  458. },
  459. handleSelectionChange(val) {
  460. this.multipleSelection = val;
  461. },
  462. getSupplierList(){
  463. axios.post("/hotel.php/cf_suplier_info/getList", this.search).then((response) => {
  464. console.log(response)
  465. let data = response.data;
  466. this.supplierList = data.list;
  467. }).catch(function (error) {
  468. console.log(error);
  469. });
  470. },
  471. getStatusName(info) {
  472. for (let i = 0; i < this.status.length; i++) {
  473. if (this.status[i].id == info.status) {
  474. return this.status[i].value
  475. }
  476. }
  477. return "-"
  478. },
  479. getUserName(info) {
  480. for (let i = 0; i < this.userList.length; i++) {
  481. if (this.userList[i].id == info.create_id) {
  482. return this.userList[i].name
  483. }
  484. }
  485. return "-"
  486. },
  487. confirmStatusName(info){
  488. for (let i = 0; i < this.confirmStatusList.length; i++) {
  489. if (this.confirmStatusList[i].id == info.confirm_status) {
  490. return this.confirmStatusList[i].name
  491. }
  492. }
  493. return "-"
  494. },
  495. sizeChange(pageSize) {
  496. this.search.pageSize = pageSize;
  497. this.getData(this.search.pageNum)
  498. },
  499. sizeOrderMainChange(pageSize) {
  500. this.orderMainListSearch.pageSize = pageSize;
  501. this.getOrderMainData(this.orderMainListSearch.pageNum)
  502. },
  503. //獲取列表
  504. getData(page) {
  505. this.search.pageNum = page;
  506. axios.post("/hotel.php/payment_order/getList", this.search).then((response) => {
  507. let data = response.data;
  508. console.log(this.tableData);
  509. if (data.flag) {
  510. this.tableData = data.data.list;
  511. this.total = data.data.total;
  512. console.log(this.tableData);
  513. } else {
  514. this.$message.error(response.msg);
  515. }
  516. }).catch(function (error) {
  517. console.log(error);
  518. });
  519. },
  520. getAdminUser() {
  521. axios.post("/hotel.php/auth/admin/getList", this.search).then((response) => {
  522. this.userList = response.data.list;
  523. }).catch(function (error) {
  524. console.log(error);
  525. });
  526. },
  527. edit(info) {
  528. if (info == null) {
  529. this.editType = false;
  530. this.editData = {
  531. name: ""
  532. }
  533. } else {
  534. this.editType = true;
  535. this.editData = {
  536. id:info.id,
  537. name: info.name,
  538. status:info.status
  539. }
  540. }
  541. this.editShow = true;
  542. },
  543. editDoing(){
  544. axios.post("/hotel.php/payment_order/save", this.editData).then( (response)=> {
  545. let data = response.data;
  546. console.log(this.tableData);
  547. if (data.flag) {
  548. this.$message.success("保存成功");
  549. this.editShow = false;
  550. this.getData(1);
  551. } else {
  552. this.$message.error(data.msg);
  553. }
  554. }).catch(function (error) {
  555. this.$message.error("保存失败");
  556. console.log(error);
  557. });
  558. },
  559. setStatus(info){
  560. this.$confirm('确定修改状态?', '提示', {
  561. confirmButtonText: '确定',
  562. cancelButtonText: '取消',
  563. type: 'warning'
  564. }).then(() => {
  565. axios.post("/hotel.php/payment_order/setStatus", info).then( (response)=> {
  566. let data = response.data;
  567. if (data.flag) {
  568. this.$message.success("设置成功");
  569. } else {
  570. this.$message.error(data.msg);
  571. this.getData(this.search.pageNum)
  572. }
  573. }).catch(function (error) {
  574. this.$message.error("保存失败");
  575. console.log(error);
  576. this.getData(this.search.pageNum)
  577. });
  578. }).catch(() => {
  579. this.$message.success("已取消");
  580. this.getData(this.search.pageNum)
  581. })
  582. },
  583. editOrderDivShow(info){
  584. console.log(info);
  585. this.editOrder = info;
  586. this.orderMainListSearch.payment_order_id = info.id;
  587. this.orderMainList=[];
  588. this.getOrderMainData(1);
  589. this.editOrderShow = true;
  590. },
  591. getOrderMainData(page){
  592. this.orderMainListSearch.pageNum = page;
  593. axios.post("/hotel.php/payment_order/getSubOrderList", this.orderMainListSearch).then((response) => {
  594. let data = response.data;
  595. console.log(this.tableData);
  596. if (data.flag) {
  597. this.orderMainList = data.data.list;
  598. this.orderMainTotal = data.data.total;
  599. console.log(this.orderMainList);
  600. } else {
  601. this.$message.error(data.msg);
  602. }
  603. }).catch(function (error) {
  604. console.log(error);
  605. });
  606. },
  607. addOrderInfo(info){
  608. let param = {
  609. hotel_id:[],
  610. item_id:[],
  611. id:this.editOrder.id
  612. }
  613. if (info.prod_type=='hotel') {
  614. param.hotel_id.push(info.id)
  615. }else{
  616. param.item_id.push(info.id)
  617. }
  618. this.addOrderMain(param)
  619. },
  620. addOrderMain(param){
  621. axios.post("/hotel.php/payment_order/addOrderMain", param).then((response) => {
  622. let data = response.data;
  623. if (data.flag) {
  624. this.$message.success("添加成功");
  625. this.getOrderMainData(this.orderMainListSearch.pageNum)
  626. this.getData(this.search.pageNum)
  627. } else {
  628. this.$message.error(data.msg);
  629. }
  630. }).catch(function (error) {
  631. console.log(error);
  632. });
  633. },
  634. addOrderAll(){
  635. let param = {
  636. hotel_id:[],
  637. item_id:[],
  638. id:this.editOrder.id
  639. }
  640. let length = this.multipleSelection.length;
  641. for (var k = 0; k < length; k++) {
  642. if (this.multipleSelection[k].prod_type=='hotel'){
  643. param.hotel_id.push(this.multipleSelection[k].id)
  644. }else{
  645. param.item_id.push(this.multipleSelection[k].id)
  646. }
  647. }
  648. this.addOrderMain(param);
  649. },
  650. removeOrderMain(info){
  651. let param = {
  652. hotel_id:[],
  653. item_id:[],
  654. id:this.editOrder.id
  655. }
  656. if (info.prod_type=='hotel') {
  657. param.hotel_id.push(info.id)
  658. }else{
  659. param.item_id.push(info.id)
  660. }
  661. axios.post("/hotel.php/payment_order/removeOrderMain", param).then((response) => {
  662. let data = response.data;
  663. if (data.flag) {
  664. this.$message.success("移除成功");
  665. this.getOrderMainData(this.orderMainListSearch.pageNum)
  666. this.getData(this.search.pageNum)
  667. } else {
  668. this.$message.error(data.msg);
  669. }
  670. }).catch(function (error) {
  671. console.log(error);
  672. });
  673. },
  674. delAll(id){
  675. let param = {
  676. id:id
  677. }
  678. this.$confirm('确定删除采购单?', '提示', {
  679. confirmButtonText: '确定',
  680. cancelButtonText: '取消',
  681. type: 'warning'
  682. }).then(() => {
  683. axios.post("/hotel.php/payment_order/delAll", param).then((response) => {
  684. let data = response.data;
  685. if (data.flag) {
  686. this.$message.success("移除成功");
  687. this.getData(this.search.pageNum)
  688. } else {
  689. this.$message.error(data.msg);
  690. }
  691. }).catch(function (error) {
  692. console.log(error);
  693. });
  694. }).catch(() => {
  695. this.$message.success("已取消");
  696. });
  697. }
  698. }
  699. })
  700. </script>
  701. <style lang="scss" scoped>
  702. .el-table thead {
  703. background-color: #5a5e66 !important;
  704. }
  705. .header-search {
  706. font-size: 14px;
  707. font-weight: 900;
  708. }
  709. body {
  710. background-color: white;
  711. }
  712. .table {
  713. width: 100%;
  714. font-size: 12px;
  715. margin-top: 12px;
  716. background-color: white;
  717. }
  718. .el-form-item{
  719. margin-bottom: 5px !important;
  720. }
  721. </style>
  722. </html>