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

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