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

index.html 32 KiB

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