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

995 lines
45 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.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>主订单ID:</span>
  37. <el-input v-model="search.order_id" style="width: 150px;" placeholder="请输入内容"></el-input>
  38. <span>子订单ID:</span>
  39. <el-input v-model="search.sub_order_id" style="width: 150px;" placeholder="请输入内容"></el-input>
  40. <span>成本</span>
  41. <el-input-number v-model="search.startCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  42. ~
  43. <el-input-number v-model="search.endCost" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
  44. <el-button type="primary" icon="el-icon-search" @click="getData(1)">搜索</el-button>
  45. <el-button type="primary" icon="el-icon-plus" @click="edit(null)">新增付款单</el-button>
  46. </div>
  47. <el-table ref="multipleTable" :data="tableData" border tooltip-effect="dark"
  48. style="font-size:12px;width: 100%;margin-top: 12px">
  49. <el-table-column prop="create_id" label="创建人" min-width="70" :formatter="getUserName"></el-table-column>
  50. <el-table-column prop="id" label="付款单号" min-width="50"></el-table-column>
  51. <el-table-column prop="name" label="付款单名称" min-width="120"></el-table-column>
  52. <el-table-column prop="status" label="付款单状态" :formatter="getStatusName" min-width="60">
  53. <template slot-scope="scope">
  54. <el-radio-group v-model="scope.row.status" size="mini" @change="setStatus(scope.row)">
  55. <el-radio-button label="0">未付款</el-radio-button>
  56. <el-radio-button label="1">付款中</el-radio-button>
  57. <el-radio-button label="2">已付款</el-radio-button>
  58. </el-radio-group>
  59. </template>
  60. </el-table-column>
  61. <el-table-column prop="order_ids" label="酒店" min-width="220">
  62. <template slot-scope="scope">
  63. <div v-html="scope.row.hotel"></div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column prop="total_amount" label="附加项目" min-width="220">
  67. <template slot-scope="scope">
  68. <div v-html="scope.row.item"></div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="create_time" label="创建时间" min-width="60"></el-table-column>
  72. <el-table-column prop="update_time" label="更新时间" min-width="60"></el-table-column>
  73. <el-table-column label="操作" min-width="140">
  74. <template slot-scope="scope">
  75. <el-button-group>
  76. <el-button type="primary" size="mini" @click="edit(scope.row)" icon="el-icon-edit" style="margin: 5px;">编辑</el-button>
  77. <el-button type="success" size="mini" @click="editOrderDivShow(scope.row)" icon="el-icon-share" style="margin: 5px;">订单</el-button>
  78. <el-button type="danger" size="mini" v-if="scope.row.status==0" icon="el-icon-delete" @click="delAll(scope.row.id)" style="margin: 5px;">删除</el-button>
  79. <el-button type="primary" size="mini" icon="el-icon-search" @click="showFile(scope.row.id)" style="margin: 5px;">附件</el-button>
  80. </el-button-group>
  81. </template>
  82. </el-table-column>
  83. </el-table>
  84. <el-pagination
  85. :page-size="search.pageSize"
  86. :pager-count="11"
  87. layout="total, sizes, prev, pager, next, jumper"
  88. :total="total"
  89. :current-page="search.pageNum"
  90. :page-sizes="[10, 20, 30, 40, 50]"
  91. @size-change="sizeChange"
  92. @current-change="getData"
  93. @prev-click="getData"
  94. @next-click="getData"
  95. ></el-pagination>
  96. </div>
  97. <transition name="bounce" v-if="editShow">
  98. <el-dialog title="付款单详情" :visible.sync="editShow" width="90%" top="15px">
  99. <el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 20px">
  100. <div style="display: flex;width: 100%">
  101. <el-form-item v-if="editType" label="付款单ID:" style="width: 80%">
  102. <div v-html="editData.id"></div>
  103. </el-form-item>
  104. </div>
  105. <div>
  106. <el-form-item label="付款单名称:" style="width: 80%">
  107. <el-input v-model="editData.name" style="width: 120px;" placeholder="请输入内容"></el-input>
  108. </el-form-item>
  109. </div>
  110. <div>
  111. <el-form-item v-if="editType" label="付款单状态:" style="width: 80%">
  112. <el-radio-group v-model="editData.status" size="mini" disabled>
  113. <el-radio-button label="0">未付款</el-radio-button>
  114. <el-radio-button label="1">付款中</el-radio-button>
  115. <el-radio-button label="2">已付款</el-radio-button>
  116. </el-radio-group>
  117. </el-form-item>
  118. </div>
  119. <div>
  120. <el-button type="primary" @click="editDoing()" >保存</el-button>
  121. </div>
  122. </el-form>
  123. </el-dialog>
  124. </transition>
  125. <transition name="bounce" v-if="editOrderShow">
  126. <el-dialog title="详情" :visible.sync="editOrderShow" width="100%" top="15px">
  127. <el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 10px">
  128. <div style="display: flex;width: 100%">
  129. <el-form-item label="付款单ID:" style="width: 80%">
  130. <div v-html="editOrder.id"></div>
  131. </el-form-item>
  132. <el-form-item label="付款单名称:" style="width: 80%">
  133. <div v-html="editOrder.name"></div>
  134. </el-form-item>
  135. <el-form-item label="付款单状态:" style="width: 80%">
  136. <el-radio-group v-model="editOrder.status" size="mini" disabled>
  137. <el-radio-button label="0">未付款</el-radio-button>
  138. <el-radio-button label="1">付款中</el-radio-button>
  139. <el-radio-button label="2">已付款</el-radio-button>
  140. </el-radio-group>
  141. </el-form-item>
  142. </div>
  143. </el-form>
  144. <div>
  145. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  146. <span>主订单ID:</span>
  147. <el-input v-model="orderMainListSearch.order_id" style="width: 120px;" placeholder="请输入内容"></el-input>
  148. <span>子订单ID:</span>
  149. <el-input v-model="orderMainListSearch.sub_order_id" style="width: 120px;" placeholder="请输入内容"></el-input>
  150. <span>订单类型:</span>
  151. <el-select v-model="orderMainListSearch.prod_type" filterable style="width: 120px;" placeholder="请选择" >
  152. <el-option
  153. v-for="item in prodTypeList"
  154. :key="item.id"
  155. :label="item.name"
  156. :value="item.id">
  157. </el-option>
  158. </el-select>
  159. <span>用户名</span>
  160. <el-input v-model="orderMainListSearch.customer_name" style="width: 120px;" placeholder="请输入内容" clearable></el-input>
  161. </div>
  162. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  163. <span>附加项目</span>
  164. <el-select v-model="orderMainListSearch.item_id" filterable style="width: 120px;" placeholder="请选择" clearable>
  165. <el-option
  166. v-for="item in itemList"
  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.hotel_id" filterable style="width: 120px;" placeholder="请选择" clearable>
  174. <el-option
  175. v-for="item in hotelList"
  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.confirm_status" filterable style="width: 120px;" placeholder="请选择" clearable>
  183. <el-option
  184. v-for="item in confirmStatusList"
  185. :key="item.id"
  186. :label="item.name"
  187. :value="item.id">
  188. </el-option>
  189. </el-select>
  190. <span>付款单状态</span>
  191. <el-select v-model="orderMainListSearch.inPayment" filterable style="width: 120px;" placeholder="请选择" clearable>
  192. <el-option
  193. v-for="item in inPaymentList"
  194. :key="item.id"
  195. :label="item.name"
  196. :value="item.id">
  197. </el-option>
  198. </el-select>
  199. <span>供应商:</span>
  200. <el-select v-model="orderMainListSearch.supplier_id" filterable style="width: 120px;" placeholder="请选择" clearable>
  201. <el-option
  202. v-for="item in supplierList"
  203. :key="item.id"
  204. :label="item.name"
  205. :value="item.id">
  206. </el-option>
  207. </el-select>
  208. </div>
  209. <div class="header-search" style="width: 100%;margin-bottom: 10px">
  210. <span>成本</span>
  211. <el-input-number v-model="orderMainListSearch.startMoney" style="width: 180px;" placeholder="请输入内容" clearable></el-input-number>
  212. ~
  213. <el-input-number v-model="orderMainListSearch.endMoney" style="width: 180px;" placeholder="请输入内容" clearable></el-input-number>
  214. <span>时间</span>
  215. <el-date-picker
  216. style="width: 180px;"
  217. v-model="orderMainListSearch.startTime"
  218. type="date"
  219. value-format="yyyy-MM-dd"
  220. :picker-options="pickerOptions"
  221. placeholder="选择日期">
  222. </el-date-picker>
  223. ~
  224. <el-date-picker
  225. style="width: 180px;"
  226. v-model="orderMainListSearch.endTime"
  227. value-format="yyyy-MM-dd"
  228. type="date"
  229. :picker-options="pickerOptions"
  230. placeholder="选择日期">
  231. </el-date-picker>
  232. <el-button type="primary" icon="el-icon-search" @click="getOrderMainData(1)">搜索</el-button>
  233. </div>
  234. <div>
  235. <el-table ref="multipleTable" :data="orderMainList" border tooltip-effect="dark" style="font-size:12px;width: 100%;margin-top: 12px" @selection-change="handleSelectionChange">
  236. <el-table-column type="selection" width="30" :selectable="checkSelect"></el-table-column>
  237. <el-table-column prop="order_id" label="主订单ID" min-width="20" ></el-table-column>
  238. <el-table-column prop="id" label="子订单ID" min-width="20" ></el-table-column>
  239. <el-table-column label="订单类型" min-width="30" :formatter="getProdTypeName" ></el-table-column>
  240. <el-table-column prop="supplier_name" label="供应商" min-width="40" ></el-table-column>
  241. <el-table-column prop="trade_order_number" label="第三方订单号" min-width="40" ></el-table-column>
  242. <el-table-column prop="hotel_name" label="酒店/项目类型" min-width="80" :formatter="getTypeName"></el-table-column>
  243. <el-table-column prop="room_name" label="房型/附加项目" min-width="80" ></el-table-column>
  244. <el-table-column prop="plan_name" label="价格方案/计价单位" min-width="40" ></el-table-column>
  245. <el-table-column prop="check_in_date" label="时间" min-width="40" >
  246. <template slot-scope="scope">
  247. <div v-html="scope.row.check_in_date"></div>
  248. <div v-html="scope.row.check_out_date"></div>
  249. </template>
  250. </el-table-column>
  251. <el-table-column prop="count" label="数量" min-width="20" ></el-table-column>
  252. <el-table-column prop="customer_name" label="出游人姓名" min-width="40" ></el-table-column>
  253. <el-table-column prop="total_cost" label="总成本" min-width="30" ></el-table-column>
  254. <el-table-column label="发单状态" min-width="30" :formatter="confirmStatusName"></el-table-column>
  255. <el-table-column prop="create_time" label="子订单生成时间" min-width="60" ></el-table-column>
  256. <el-table-column prop="payment_order_name" label="付款单" min-width="40" >
  257. <template slot-scope="scope">
  258. <div v-html="scope.row.payment_order_id"></div>
  259. <div v-html="scope.row.payment_order_name"></div>
  260. </template>
  261. </el-table-column>
  262. <el-table-column label="财务备注" min-width="40" >
  263. <template slot-scope="scope">
  264. <el-popover
  265. placement="left"
  266. placement="top-start"
  267. title="备注:"
  268. width="500"
  269. trigger="hover">
  270. <div>
  271. <div>
  272. <el-input
  273. style="margin: 5px"
  274. type="textarea"
  275. :rows="2"
  276. placeholder="无"
  277. v-model="scope.row.finance_memo">
  278. </el-input>
  279. </div>
  280. <div>
  281. <el-button type="primary" slot="reference" @click="setFinanceMemo(scope.row)" size="small" style="margin: 5px">变更提交</el-button>
  282. </div>
  283. </div>
  284. <el-button slot="reference" size="small" >查看</el-button>
  285. </el-popover>
  286. </template>
  287. </el-table-column>
  288. <el-table-column label="操作" >
  289. <template slot-scope="scope">
  290. <el-button-group>
  291. <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>
  292. <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>
  293. </el-button-group>
  294. </template>
  295. </el-table-column>
  296. </el-table>
  297. <div style="margin-top: 5px">
  298. <el-button type="primary" icon="el-icon-circle-plus" @click="addOrderAll()" :disabled="multipleSelection.length==0">添加到采购单</el-button>
  299. </div>
  300. <el-pagination
  301. :page-size="orderMainListSearch.pageSize"
  302. :pager-count="11"
  303. layout="total, sizes, prev, pager, next, jumper"
  304. :total="orderMainTotal"
  305. :current-page="orderMainListSearch.pageNum"
  306. :page-sizes="[10, 20, 30, 40, 50]"
  307. @size-change="sizeOrderMainChange"
  308. @current-change="getOrderMainData"
  309. @prev-click="getOrderMainData"
  310. @next-click="getOrderMainData"
  311. ></el-pagination>
  312. </div>
  313. </div>
  314. </el-dialog>
  315. </transition>
  316. <transition name="bounce" v-if="showFileFlag">
  317. <el-dialog title="附件详情" :visible.sync="showFileFlag" width="90%" top="15px">
  318. <el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 20px">
  319. <div style="display: flex;width: 100%">
  320. <el-form-item label="账单ID:" style="width: 80%">
  321. <div v-html="fileData.id"></div>
  322. </el-form-item>
  323. </div>
  324. <div>
  325. <el-form-item label="名称标识:" style="width: 80%">
  326. <el-input v-model="fileData.name" style="width: 120px;" placeholder="请输入内容" clearable></el-input>
  327. </el-form-item>
  328. </div>
  329. <div>
  330. <el-form-item label="文件:" style="width: 80%">
  331. <div>
  332. <el-upload
  333. :multiple="false"
  334. :limit="1"
  335. class="upload-demo"
  336. action="/hotel.php/ajax/upload"
  337. :on-change="handleChange"
  338. :on-exceed="handleExceed"
  339. :file-list="fileList">
  340. <el-button size="small" type="primary">点击上传</el-button>
  341. </el-upload>
  342. </div>
  343. </el-form-item>
  344. </div>
  345. <div>
  346. <el-button type="primary" @click="fileSubmit()" >提交</el-button>
  347. </div>
  348. </el-form>
  349. <el-table ref="multipleTable" :data="fileTable" border tooltip-effect="dark" style="font-size:12px;width: 100%;margin-top: 12px">
  350. <el-table-column prop="name" label="名称标识" min-width="140" ></el-table-column>
  351. <el-table-column prop="create_name" label="创建人" min-width="70" ></el-table-column>
  352. <el-table-column prop="create_time" label="创建时间" min-width="70" ></el-table-column>
  353. <el-table-column label="点击下载" min-width="40" >
  354. <template slot-scope="scope">
  355. <el-link :href="scope.row.file" target="_blank" style="color: #0a568c">下载</el-link>
  356. </template>
  357. </el-table-column>
  358. </el-table>
  359. </el-dialog>
  360. </transition>
  361. </div>
  362. </body>
  363. <!-- import Vue before Element -->
  364. <script src="/assets/js/vue/vue.js"></script>
  365. <!-- import JavaScript -->
  366. <script src="/assets/js/vue/index.js"></script>
  367. <script src="/assets/js/axios/dist/axios.min.js"></script>
  368. <script>
  369. new Vue({
  370. el: '#app',
  371. data: function () {
  372. return {
  373. search: {
  374. sub_order_id:"",
  375. order_id:"",
  376. id:"",
  377. create_id:"",
  378. name: "",
  379. status: "all",
  380. startCost:"",
  381. endCost:"",
  382. pageSize: 10,
  383. pageNum: 1
  384. },
  385. status: [
  386. {"id": "all", "value": "请选择"},
  387. {"id": 0, 'value': "未付款"},
  388. {"id": 1, 'value': "付款中"},
  389. {"id": 2, 'value': "已付款"}
  390. ],
  391. total: 0,
  392. tableData: [],
  393. userList: [],
  394. info: {
  395. id: null,
  396. name: "",
  397. status: 0,
  398. list: []
  399. },
  400. editShow: false,
  401. editType: false,
  402. editData: {},
  403. editOrderShow:false,
  404. editOrder:{},
  405. orderMainListSearch:{
  406. "payment_order_id":"",
  407. "order_id":"",
  408. "sub_order_id":"",
  409. "prod_type":"hotel",
  410. "supplier_id":"",
  411. "inPayment":"",
  412. "confirm_status":"",
  413. "customer_name":"",
  414. "startMoney":"",
  415. "endMoney":"",
  416. "startTime":"",
  417. "endTime":"",
  418. "pageNum":1,
  419. "pageSize":10,
  420. "item_id":"",
  421. "hotel_id":"",
  422. "room_id":"",
  423. "plan_id":""
  424. },
  425. orderMainTotal:0,
  426. orderMainList:[],
  427. inPaymentList:[
  428. {id:1,name:"在此付款单中"},
  429. {id:2,name:"不在此付款单中"},
  430. {id:3,name:"不在任何付款单中"}
  431. ],
  432. //1、未发单/ 2已发单、3已确认、4已取消
  433. confirmStatusList:[
  434. {id:1,name:"未发单"},
  435. {id:2,name:"已发单"},
  436. {id:3,name:"已确认"},
  437. {id:4,name:"已取消"}
  438. ],
  439. prodTypeList:[
  440. {id:"hotel",name:"酒店"},
  441. {id:"item",name:"附加项目"}
  442. ],
  443. supplierList:[],
  444. multipleSelection: [],
  445. hotelList:[],
  446. itemList:[],
  447. type_list:[],
  448. pickerOptions: {
  449. shortcuts: [{
  450. text: '今天',
  451. onClick(picker) {
  452. picker.$emit('pick', new Date());
  453. }
  454. }, {
  455. text: '昨天',
  456. onClick(picker) {
  457. const date = new Date();
  458. date.setTime(date.getTime() - 3600 * 1000 * 24);
  459. picker.$emit('pick', date);
  460. }
  461. }, {
  462. text: '一周前',
  463. onClick(picker) {
  464. const date = new Date();
  465. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  466. picker.$emit('pick', date);
  467. }
  468. }]
  469. },
  470. showFileFlag:false,
  471. fileData:{
  472. "id":"",
  473. "name":"",
  474. "file":"",
  475. "type":"pay"
  476. },
  477. fileTable:[],
  478. fileList:[]
  479. }
  480. },
  481. created() {
  482. this.getAdminUser();
  483. this.getSupplierList();
  484. this.getData(1)
  485. this.getHotelList()
  486. this.getConfig()
  487. this.getItemList()
  488. },
  489. watch: {
  490. "orderMainListSearch.prod_type" : function (newVal,oldVal){
  491. this.getOrderMainData(1)
  492. }
  493. },
  494. methods: {
  495. setFinanceMemo(info){
  496. let param = {
  497. "type": info["prod_type"],
  498. "finance_memo":info["finance_memo"],
  499. "order_id":info["id"]
  500. }
  501. axios.post("/hotel.php/order_main/setFinanceMemo", param).then((response) => {
  502. let data = response.data;
  503. if (data.flag) {
  504. this.$message({
  505. offset:0,
  506. showClose:true,duration:1500,
  507. type: 'success',
  508. message: '成功'
  509. });
  510. } else {
  511. this.$message({
  512. offset:0,
  513. showClose:true,duration:1500,
  514. type: 'error',
  515. message:response.msg});
  516. }
  517. }).catch(function (error) {
  518. console.log(error);
  519. });
  520. },
  521. handleChange(file, fileList) {
  522. this.fileList = fileList.slice(-3);
  523. },
  524. showFile(id){
  525. this.fileData["id"]=id;
  526. this.showFileFlag = true
  527. axios.post("/hotel.php/order_main/getFileList", this.fileData).then((response) => {
  528. let data = response.data;
  529. if (data.flag) {
  530. this.fileTable = data.data
  531. } else {
  532. this.$message({
  533. offset:0,
  534. showClose:true,duration:1500,
  535. type: 'error',
  536. message:response.msg});
  537. }
  538. }).catch(function (error) {
  539. console.log(error);
  540. });
  541. },
  542. handleExceed(files, fileList) {
  543. this.$message.warning({
  544. offset:0,
  545. showClose:true,duration:1500,
  546. type: 'success',
  547. message:`当前限制选择 1 个文件`});
  548. },
  549. fileSubmit(){
  550. if (this.fileList.length==0) {
  551. this.$message({
  552. offset:0,
  553. showClose:true,duration:1500,
  554. type: 'error',
  555. message:`请选择文件`});
  556. return false;
  557. }
  558. if (this.fileData["name"]=="") {
  559. this.$message({
  560. offset:0,
  561. showClose:true,duration:1500,
  562. type: 'error',
  563. message:`请输入名称标识`});
  564. return false;
  565. }
  566. let file = this.fileList[0].response.data.url;
  567. this.fileData["file"]=file;
  568. axios.post("/hotel.php/order_main/addFileInfo", this.fileData).then((response) => {
  569. let data = response.data;
  570. if (data.flag) {
  571. this.fileList=[]
  572. this.showFile(this.fileData["id"])
  573. } else {
  574. this.$message({
  575. offset:0,
  576. showClose:true,duration:1500,
  577. type: 'error',
  578. message:response.msg});
  579. }
  580. }).catch(function (error) {
  581. console.log(error);
  582. });
  583. },
  584. getTypeName(info) {
  585. for (let i = 0; i < this.type_list.length; i++) {
  586. if (this.type_list[i].id == info.hotel_name) {
  587. return this.type_list[i].name
  588. }
  589. }
  590. return info.hotel_name
  591. },
  592. getConfig(){
  593. axios.post("/hotel.php/general/config/getList?key=site.item_category", {}).then((response) => {
  594. let data = response.data;
  595. this.type_list = data.list;
  596. }).catch(function (error) {
  597. console.log(error);
  598. });
  599. },
  600. getProdTypeName(info){
  601. for (let i = 0; i < this.prodTypeList.length; i++) {
  602. if (this.prodTypeList[i].id == info.prod_type) {
  603. return this.prodTypeList[i].name
  604. }
  605. }
  606. return "-"
  607. },
  608. getHotelList(){
  609. axios.post("/hotel.php/cf_hotel_info/getHotelList", this.search).then((response) => {
  610. console.log(response)
  611. let data = response.data;
  612. this.hotelList = data.list;
  613. }).catch(function (error) {
  614. console.log(error);
  615. });
  616. },
  617. getItemList(){
  618. axios.post("/hotel.php/cf_item/getList", this.search).then((response) => {
  619. console.log(response)
  620. let data = response.data;
  621. this.itemList = data.list;
  622. }).catch(function (error) {
  623. console.log(error);
  624. });
  625. },
  626. checkSelect(row,index){
  627. if (this.editOrder.status != 0) {
  628. return false;
  629. }
  630. if (row.payment_order_id ==0) {
  631. return true;
  632. }
  633. return false;
  634. },
  635. handleSelectionChange(val) {
  636. this.multipleSelection = val;
  637. },
  638. getSupplierList(){
  639. axios.post("/hotel.php/cf_suplier_info/getList", this.search).then((response) => {
  640. console.log(response)
  641. let data = response.data;
  642. this.supplierList = data.list;
  643. }).catch(function (error) {
  644. console.log(error);
  645. });
  646. },
  647. getStatusName(info) {
  648. for (let i = 0; i < this.status.length; i++) {
  649. if (this.status[i].id == info.status) {
  650. return this.status[i].value
  651. }
  652. }
  653. return "-"
  654. },
  655. getUserName(info) {
  656. for (let i = 0; i < this.userList.length; i++) {
  657. if (this.userList[i].id == info.create_id) {
  658. return this.userList[i].name
  659. }
  660. }
  661. return "-"
  662. },
  663. confirmStatusName(info){
  664. for (let i = 0; i < this.confirmStatusList.length; i++) {
  665. if (this.confirmStatusList[i].id == info.confirm_status) {
  666. return this.confirmStatusList[i].name
  667. }
  668. }
  669. return "-"
  670. },
  671. sizeChange(pageSize) {
  672. this.search.pageSize = pageSize;
  673. this.getData(this.search.pageNum)
  674. },
  675. sizeOrderMainChange(pageSize) {
  676. this.orderMainListSearch.pageSize = pageSize;
  677. this.getOrderMainData(this.orderMainListSearch.pageNum)
  678. },
  679. //獲取列表
  680. getData(page) {
  681. this.search.pageNum = page;
  682. axios.post("/hotel.php/payment_order/getList", this.search).then((response) => {
  683. let data = response.data;
  684. console.log(this.tableData);
  685. if (data.flag) {
  686. this.tableData = data.data.list;
  687. this.total = data.data.total;
  688. console.log(this.tableData);
  689. } else {
  690. this.$message({
  691. offset:0,
  692. showClose:true,duration:1500,
  693. type: 'error',
  694. message:response.msg});
  695. }
  696. }).catch(function (error) {
  697. console.log(error);
  698. });
  699. },
  700. getAdminUser() {
  701. axios.post("/hotel.php/auth/admin/getList", this.search).then((response) => {
  702. this.userList = response.data.list;
  703. }).catch(function (error) {
  704. console.log(error);
  705. });
  706. },
  707. edit(info) {
  708. if (info == null) {
  709. this.editType = false;
  710. this.editData = {
  711. name: ""
  712. }
  713. } else {
  714. this.editType = true;
  715. this.editData = {
  716. id:info.id,
  717. name: info.name,
  718. status:info.status
  719. }
  720. }
  721. this.editShow = true;
  722. },
  723. editDoing(){
  724. axios.post("/hotel.php/payment_order/save", this.editData).then( (response)=> {
  725. let data = response.data;
  726. console.log(this.tableData);
  727. if (data.flag) {
  728. this.$message({
  729. offset:0,
  730. showClose:true,duration:1500,
  731. type: 'success',
  732. message: '成功'
  733. });
  734. this.editShow = false;
  735. this.getData(1);
  736. } else {
  737. this.$message({
  738. offset:0,
  739. showClose:true,duration:1500,
  740. type: 'error',
  741. message:data.msg});
  742. }
  743. }).catch(function (error) {
  744. this.$message({
  745. offset:0,
  746. showClose:true,duration:1500,
  747. type: 'error',
  748. message:"保存失败"});
  749. console.log(error);
  750. });
  751. },
  752. setStatus(info){
  753. this.$confirm('确定修改状态?', '提示', {
  754. confirmButtonText: '确定',
  755. cancelButtonText: '取消',
  756. type: 'warning'
  757. }).then(() => {
  758. axios.post("/hotel.php/payment_order/setStatus", info).then( (response)=> {
  759. let data = response.data;
  760. if (data.flag) {
  761. this.$message({
  762. offset:0,
  763. showClose:true,duration:1500,
  764. type: 'success',
  765. message: '成功'
  766. });
  767. } else {
  768. this.$message({
  769. offset:0,
  770. showClose:true,duration:1500,
  771. type: 'error',
  772. message:data.msg});
  773. this.getData(this.search.pageNum)
  774. }
  775. }).catch(function (error) {
  776. this.$message({
  777. offset:0,
  778. showClose:true,duration:1500,
  779. type: 'error',
  780. message:"保存失败"});
  781. console.log(error);
  782. this.getData(this.search.pageNum)
  783. });
  784. }).catch(() => {
  785. this.$message({
  786. offset:0,
  787. showClose:true,duration:1500,
  788. type: 'success',
  789. message: '已取消'
  790. });
  791. this.getData(this.search.pageNum)
  792. })
  793. },
  794. editOrderDivShow(info){
  795. console.log(info);
  796. this.editOrder = info;
  797. this.orderMainListSearch.payment_order_id = info.id;
  798. this.orderMainList=[];
  799. this.getOrderMainData(1);
  800. this.editOrderShow = true;
  801. },
  802. getOrderMainData(page){
  803. this.orderMainListSearch.pageNum = page;
  804. axios.post("/hotel.php/payment_order/getSubOrderList", this.orderMainListSearch).then((response) => {
  805. let data = response.data;
  806. console.log(this.tableData);
  807. if (data.flag) {
  808. this.orderMainList = data.data.list;
  809. this.orderMainTotal = data.data.total;
  810. console.log(this.orderMainList);
  811. } else {
  812. this.$message({
  813. offset:0,
  814. showClose:true,duration:1500,
  815. type: 'error',
  816. message:data.msg});
  817. }
  818. }).catch(function (error) {
  819. console.log(error);
  820. });
  821. },
  822. addOrderInfo(info){
  823. let param = {
  824. hotel_id:[],
  825. item_id:[],
  826. id:this.editOrder.id
  827. }
  828. if (info.prod_type=='hotel') {
  829. param.hotel_id.push(info.id)
  830. }else{
  831. param.item_id.push(info.id)
  832. }
  833. this.addOrderMain(param)
  834. },
  835. addOrderMain(param){
  836. axios.post("/hotel.php/payment_order/addOrderMain", param).then((response) => {
  837. let data = response.data;
  838. if (data.flag) {
  839. this.$message({
  840. offset:0,
  841. showClose:true,duration:1500,
  842. type: 'success',
  843. message: '成功'
  844. });
  845. this.getOrderMainData(this.orderMainListSearch.pageNum)
  846. this.getData(this.search.pageNum)
  847. } else {
  848. this.$message({
  849. offset:0,
  850. showClose:true,duration:1500,
  851. type: 'error',
  852. message:data.msg});
  853. }
  854. }).catch(function (error) {
  855. console.log(error);
  856. });
  857. },
  858. addOrderAll(){
  859. let param = {
  860. hotel_id:[],
  861. item_id:[],
  862. id:this.editOrder.id
  863. }
  864. let length = this.multipleSelection.length;
  865. for (var k = 0; k < length; k++) {
  866. if (this.multipleSelection[k].prod_type=='hotel'){
  867. param.hotel_id.push(this.multipleSelection[k].id)
  868. }else{
  869. param.item_id.push(this.multipleSelection[k].id)
  870. }
  871. }
  872. this.addOrderMain(param);
  873. },
  874. removeOrderMain(info){
  875. let param = {
  876. hotel_id:[],
  877. item_id:[],
  878. id:this.editOrder.id
  879. }
  880. if (info.prod_type=='hotel') {
  881. param.hotel_id.push(info.id)
  882. }else{
  883. param.item_id.push(info.id)
  884. }
  885. axios.post("/hotel.php/payment_order/removeOrderMain", param).then((response) => {
  886. let data = response.data;
  887. if (data.flag) {
  888. this.$message({
  889. offset:0,
  890. showClose:true,duration:1500,
  891. type: 'success',
  892. message: '成功'
  893. });
  894. this.getOrderMainData(this.orderMainListSearch.pageNum)
  895. this.getData(this.search.pageNum)
  896. } else {
  897. this.$message({
  898. offset:0,
  899. showClose:true,duration:1500,
  900. type: 'error',
  901. message:data.msg});
  902. }
  903. }).catch(function (error) {
  904. console.log(error);
  905. });
  906. },
  907. delAll(id){
  908. let param = {
  909. id:id
  910. }
  911. this.$confirm('确定删除采购单?', '提示', {
  912. confirmButtonText: '确定',
  913. cancelButtonText: '取消',
  914. type: 'warning'
  915. }).then(() => {
  916. axios.post("/hotel.php/payment_order/delAll", param).then((response) => {
  917. let data = response.data;
  918. if (data.flag) {
  919. this.$message({
  920. offset:0,
  921. showClose:true,duration:1500,
  922. type: 'success',
  923. message: '成功'
  924. });
  925. this.getData(this.search.pageNum)
  926. } else {
  927. this.$message({
  928. offset:0,
  929. showClose:true,duration:1500,
  930. type: 'error',
  931. message:data.msg});
  932. }
  933. }).catch(function (error) {
  934. console.log(error);
  935. });
  936. }).catch(() => {
  937. this.$message({
  938. offset:0,
  939. showClose:true,duration:1500,
  940. type: 'success',
  941. message: '已取消'
  942. });
  943. });
  944. }
  945. }
  946. })
  947. </script>
  948. <style lang="scss" scoped>
  949. .upload .el-upload__input {
  950. display: none !important;
  951. }
  952. input[type="file"] {
  953. display: none !important;
  954. }
  955. .el-table thead {
  956. background-color: #5a5e66 !important;
  957. }
  958. .header-search {
  959. font-size: 14px;
  960. font-weight: 900;
  961. }
  962. body {
  963. background-color: white;
  964. }
  965. .table {
  966. width: 100%;
  967. font-size: 12px;
  968. margin-top: 12px;
  969. background-color: white;
  970. }
  971. .el-form-item{
  972. margin-bottom: 5px !important;
  973. }
  974. </style>
  975. </html>