|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <!-- import CSS -->
- <link rel="stylesheet" href="/assets/theme-chalk/index.css">
- </head>
- <body>
- <div id="app" class="table">
- <div>
- <div class="header-search" style="width: 100%;margin-bottom: 10px">
- <span>付款单ID:</span>
- <el-input v-model="search.id" style="width: 120px;" placeholder="请输入内容" clearable></el-input>
- <span>名称:</span>
- <el-input v-model="search.name" style="width: 150px;" placeholder="请输入内容"></el-input>
- <span>状态</span>
- <el-select v-model="search.status" filterable placeholder="请选择" clearable>
- <el-option
- v-for="item in status"
- :key="item.id"
- :label="item.value"
- :value="item.id">
- </el-option>
- </el-select>
- <span>创建人</span>
- <el-select v-model="search.create_id" filterable placeholder="请选择" clearable>
- <el-option
- v-for="item in userList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
-
- </div>
- <div class="header-search" style="width: 100%;margin-bottom: 10px">
- <span>订单ID:</span>
- <el-input v-model="search.order_id" style="width: 150px;" placeholder="请输入内容"></el-input>
- <span>金额</span>
- <el-input-number v-model="search.startMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
- ~
- <el-input-number v-model="search.endMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
- <el-button type="primary" icon="el-icon-search" @click="getData(1)">搜索</el-button>
- <el-button type="primary" icon="el-icon-plus" @click="edit(null)">新增收款单</el-button>
- </div>
-
- <el-table ref="multipleTable" :data="tableData" border tooltip-effect="dark"
- style="font-size:12px;width: 100%;margin-top: 12px">
- <el-table-column prop="create_id" label="创建人" min-width="70" :formatter="getUserName"></el-table-column>
- <el-table-column prop="id" label="收款单号" min-width="50"></el-table-column>
- <el-table-column prop="name" label="收款单名称" min-width="120"></el-table-column>
- <el-table-column prop="status" label="收款单状态" :formatter="getStatusName" min-width="140">
- <template slot-scope="scope">
- <el-radio-group v-model="scope.row.status" size="mini" @change="setStatus(scope.row)">
- <el-radio-button label="0">未收款</el-radio-button>
- <el-radio-button label="1">收款中</el-radio-button>
- <el-radio-button label="2">已收款</el-radio-button>
- </el-radio-group>
- </template>
- </el-table-column>
- <el-table-column prop="order_ids" label="关联订单" min-width="150"></el-table-column>
- <el-table-column prop="total_amount" label="金额" min-width="60"></el-table-column>
- <el-table-column prop="create_time" label="创建时间" min-width="80"></el-table-column>
- <el-table-column prop="update_time" label="更新时间" min-width="80"></el-table-column>
- <el-table-column label="操作" min-width="180">
- <template slot-scope="scope">
- <el-button-group>
- <el-button type="primary" size="mini" @click="edit(scope.row)" icon="el-icon-edit" style="margin: 5px;">编辑</el-button>
- <el-button type="success" size="mini" @click="editOrderDivShow(scope.row)" icon="el-icon-share" style="margin: 5px;">订单</el-button>
- <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>
- <el-button type="primary" size="mini" icon="el-icon-search" @click="showFile(scope.row.id)" style="margin: 5px;">附件</el-button>
- </el-button-group>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- :page-size="search.pageSize"
- :pager-count="11"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- :current-page="search.pageNum"
- :page-sizes="[10, 20, 30, 40, 50]"
- @size-change="sizeChange"
- @current-change="getData"
- @prev-click="getData"
- @next-click="getData"
- ></el-pagination>
- </div>
-
-
- <transition name="bounce" v-if="editShow">
- <el-dialog title="收款单详情" :visible.sync="editShow" width="90%" top="15px">
- <el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 20px">
- <div style="display: flex;width: 100%">
- <el-form-item v-if="editType" label="收款单ID:" style="width: 80%">
- <div v-html="editData.id"></div>
- </el-form-item>
- </div>
- <div>
- <el-form-item label="收款单名称:" style="width: 80%">
- <el-input v-model="editData.name" style="width: 150px;" placeholder="请输入内容"></el-input>
- </el-form-item>
- </div>
- <div>
- <el-form-item v-if="editType" label="收款单状态:" style="width: 80%">
- <el-radio-group v-model="editData.status" size="mini" disabled>
- <el-radio-button label="0">未收款</el-radio-button>
- <el-radio-button label="1">收款中</el-radio-button>
- <el-radio-button label="2">已收款</el-radio-button>
- </el-radio-group>
- </el-form-item>
- </div>
- <div>
- <el-button type="primary" @click="editDoing()" >保存</el-button>
- </div>
- </el-form>
- </el-dialog>
- </transition>
-
-
- <transition name="bounce" v-if="editOrderShow">
- <el-dialog title="详情" :visible.sync="editOrderShow" width="90%" top="15px">
- <el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 10px">
- <div style="display: flex;width: 100%">
- <el-form-item label="收款单ID:" style="width: 80%">
- <div v-html="editOrder.id"></div>
- </el-form-item>
- <el-form-item label="收款单名称:" style="width: 80%">
- <div v-html="editOrder.name"></div>
- </el-form-item>
- <el-form-item label="收款单状态:" style="width: 80%">
- <el-radio-group v-model="editOrder.status" size="mini" disabled>
- <el-radio-button label="0">未收款</el-radio-button>
- <el-radio-button label="1">收款中</el-radio-button>
- <el-radio-button label="2">已收款</el-radio-button>
- </el-radio-group>
- </el-form-item>
- </div>
- </el-form>
- <div>
- <div class="header-search" style="width: 100%;margin-bottom: 10px">
- <span>订单状态:</span>
- <el-select v-model="orderMainListSearch.order_status" filterable style="width: 150px;" placeholder="请选择" clearable>
- <el-option
- v-for="item in orderMainStatus"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- <span>收款单状态</span>
- <el-select v-model="orderMainListSearch.inReceipt" style="width: 150px;" filterable placeholder="请选择" clearable>
- <el-option
- v-for="item in inReceipt"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- <div class="header-search" style="width: 100%;margin-bottom: 10px">
- <span>用户名</span>
- <el-input v-model="orderMainListSearch.user_name" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
- <span>渠道:</span>
- <el-select v-model="orderMainListSearch.channel_id" style="width: 150px;" filterable placeholder="请选择" clearable>
- <el-option
- v-for="item in channelList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- <span>渠道订单号:</span>
- <el-input v-model="orderMainListSearch.channel_order_no" style="width: 150px;" placeholder="请输入内容"></el-input>
- <span>专员</span>
- <el-select v-model="orderMainListSearch.commissioner_id" style="width: 150px;" filterable placeholder="请选择" clearable>
- <el-option
- v-for="item in userList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- <span>下单人</span>
- <el-select v-model="orderMainListSearch.create_id" style="width: 150px;" filterable placeholder="请选择" clearable>
- <el-option
- v-for="item in userList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- <div class="header-search" style="width: 100%;margin-bottom: 10px">
- <span>订单号</span>
- <el-input v-model="orderMainListSearch.order_id" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
- <span>手机号</span>
- <el-input v-model="orderMainListSearch.user_phone" style="width: 150px;" placeholder="请输入内容" clearable></el-input>
- <span>金额</span>
- <el-input-number v-model="orderMainListSearch.startMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
- ~
- <el-input-number v-model="orderMainListSearch.endMoney" style="width: 170px;" placeholder="请输入内容" clearable></el-input-number>
- <span>时间</span>
- <el-date-picker
- style="width: 150px;"
- v-model="orderMainListSearch.startTime"
- type="date"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions"
- placeholder="选择日期">
- </el-date-picker>
- ~
- <el-date-picker
- style="width: 150px;"
- v-model="orderMainListSearch.endTime"
- value-format="yyyy-MM-dd"
- type="date"
- :picker-options="pickerOptions"
- placeholder="选择日期">
- </el-date-picker>
- <el-button type="primary" icon="el-icon-search" @click="getOrderMainData(1)">搜索</el-button>
- </div>
- <div>
- <el-table ref="multipleTable" :data="orderMainList" border tooltip-effect="dark" style="font-size:12px;width: 100%;margin-top: 12px" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="30" :selectable="checkSelect"></el-table-column>
- <el-table-column prop="id" label="订单ID" min-width="40" ></el-table-column>
- <el-table-column prop="commissioner" label="专员" min-width="40" ></el-table-column>
- <el-table-column prop="channel_name" label="渠道" min-width="80" ></el-table-column>
- <el-table-column prop="channel_order_no" label="渠道订单号" min-width="90" ></el-table-column>
- <el-table-column prop="create_id" label="下单人" min-width="50" :formatter="getUserName"></el-table-column>
- <el-table-column prop="user_name" label="用户名称" min-width="50" ></el-table-column>
- <el-table-column prop="user_phone" label="手机号" min-width="60" ></el-table-column>
- <el-table-column prop="total_amount" label="总金额" min-width="40" ></el-table-column>
- <el-table-column prop="order_status" label="状态" min-width="40" :formatter="getOrderMainStatus"></el-table-column>
- <el-table-column prop="create_time" label="下单时间" min-width="80" ></el-table-column>
- <el-table-column prop="receipt_order_id" label="收款单ID" min-width="40" ></el-table-column>
- <el-table-column prop="receipt_order_name" label="收款单名称" min-width="80" ></el-table-column>
- <el-table-column label="财务备注" min-width="40" >
- <template slot-scope="scope">
- <el-popover
- placement="left"
- placement="top-start"
- title="备注:"
- width="500"
- trigger="hover">
- <div>
- <div>
- <el-input
- style="margin: 5px"
- type="textarea"
- :rows="2"
- placeholder="无"
- v-model="scope.row.finance_memo">
- </el-input>
- </div>
- <div>
- <el-button type="primary" slot="reference" @click="setFinanceMemo(scope.row)" size="small" style="margin: 5px">变更提交</el-button>
- </div>
- </div>
- <el-button slot="reference" size="small" >查看</el-button>
- </el-popover>
-
- </template>
- </el-table-column>
- <el-table-column label="操作" >
- <template slot-scope="scope">
- <el-button-group>
- <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>
- <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>
- </el-button-group>
- </template>
- </el-table-column>
-
- </el-table>
- <div style="margin-top: 5px">
- <el-button type="primary" icon="el-icon-circle-plus" @click="addOrderAll()" :disabled="multipleSelection.length==0">添加到采购单</el-button>
- </div>
- <el-pagination
- :page-size="orderMainListSearch.pageSize"
- :pager-count="11"
- layout="total, sizes, prev, pager, next, jumper"
- :total="orderMainTotal"
- :current-page="orderMainListSearch.pageNum"
- :page-sizes="[10, 20, 30, 40, 50]"
- @size-change="sizeOrderMainChange"
- @current-change="getOrderMainData"
- @prev-click="getOrderMainData"
- @next-click="getOrderMainData"
- ></el-pagination>
- </div>
- </div>
- </el-dialog>
- </transition>
-
- <transition name="bounce" v-if="showFileFlag">
- <el-dialog title="附件详情" :visible.sync="showFileFlag" width="90%" top="15px">
- <el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 20px">
- <div style="display: flex;width: 100%">
- <el-form-item label="账单ID:" style="width: 80%">
- <div v-html="fileData.id"></div>
- </el-form-item>
- </div>
- <div>
- <el-form-item label="名称标识:" style="width: 80%">
- <el-input v-model="fileData.name" style="width: 120px;" placeholder="请输入内容" clearable></el-input>
- </el-form-item>
- </div>
- <div>
- <el-form-item label="文件:" style="width: 80%">
- <div>
- <el-upload
- :multiple="false"
- :limit="1"
- class="upload-demo"
- action="/hotel.php/ajax/upload"
- :on-change="handleChange"
- :on-exceed="handleExceed"
- :file-list="fileList">
- <el-button size="small" type="primary">点击上传</el-button>
- </el-upload>
- </div>
- </el-form-item>
- </div>
- <div>
- <el-button type="primary" @click="fileSubmit()" >提交</el-button>
- </div>
- </el-form>
- <el-table ref="multipleTable" :data="fileTable" border tooltip-effect="dark" style="font-size:12px;width: 100%;margin-top: 12px">
- <el-table-column prop="name" label="名称标识" min-width="140" ></el-table-column>
- <el-table-column prop="create_name" label="创建人" min-width="70" ></el-table-column>
- <el-table-column prop="create_time" label="创建时间" min-width="70" ></el-table-column>
- <el-table-column label="点击下载" min-width="40" >
- <template slot-scope="scope">
- <el-link :href="scope.row.file" target="_blank" style="color: #0a568c">下载</el-link>
- </template>
- </el-table-column>
-
- </el-table>
- </el-dialog>
- </transition>
- </div>
- </body>
- <!-- import Vue before Element -->
- <script src="/assets/js/vue/vue.js"></script>
- <!-- import JavaScript -->
- <script src="/assets/js/vue/index.js"></script>
- <script src="/assets/js/axios/dist/axios.min.js"></script>
- <script>
- new Vue({
- el: '#app',
- data: function () {
- return {
- search: {
- order_id:"",
- id:"",
- create_id:"",
- name: "",
- status: "all",
- startMoney:0,
- endMoney:0,
- pageSize: 10,
- pageNum: 1
- },
- status: [
- {"id": "all", "value": "请选择"},
- {"id": 0, 'value': "未收款"},
- {"id": 1, 'value': "收款中"},
- {"id": 2, 'value': "已收款"}
- ],
- total: 0,
- tableData: [],
- userList: [],
- info: {
- id: null,
- name: "",
- status: 0,
- list: []
- },
- editShow: false,
- editType: false,
- editData: {},
- editOrderShow:false,
- editOrder:{},
- orderMainListSearch:{
- "receipt_order_id":"",
- "inReceipt":"",
- "order_id":"",
- "channel_order_no":"",
- "channel_id":"",
- "order_status":"",
- "commissioner_id":"",
- "user_name":"",
- "user_phone":"",
- "create_id":"",
- "startMoney":"",
- "endMoney":"",
- "startTime":"",
- "endTime":"",
- "pageNum":1,
- "pageSize":10
- },
- orderMainTotal:0,
- orderMainList:[],
- inReceipt:[
- {id:1,name:"在此收款单中"},
- {id:2,name:"不在此收款单中"},
- {id:3,name:"不在任何收款单中"}
- ],
- //0待处理 1已确认 2部分取消 10已完成 11已取消
- orderMainStatus:[
- {id:0,name:"待处理"},
- {id:1,name:"已确认"},
- {id:2,name:"部分取消"},
- {id:3,name:"处理中"},
- {id:10,name:"已完成"},
- {id:11,name:"已取消"}
- ],
- channelList:[],
- multipleSelection: [],
- pickerOptions: {
- shortcuts: [{
- text: '今天',
- onClick(picker) {
- picker.$emit('pick', new Date());
- }
- }, {
- text: '昨天',
- onClick(picker) {
- const date = new Date();
- date.setTime(date.getTime() - 3600 * 1000 * 24);
- picker.$emit('pick', date);
- }
- }, {
- text: '一周前',
- onClick(picker) {
- const date = new Date();
- date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit('pick', date);
- }
- }]
- },
- showFileFlag:false,
- fileData:{
- "id":"",
- "name":"",
- "file":"",
- "type":"receipt"
- },
- fileTable:[],
- fileList:[]
- }
- },
- created() {
- this.getAdminUser();
- this.getChannelList();
- this.getData(1)
-
- },
- methods: {
- setFinanceMemo(info){
- let param = {
- "type": "order",
- "finance_memo":info["finance_memo"],
- "order_id":info["id"]
- }
- axios.post("/hotel.php/order_main/setFinanceMemo", param).then((response) => {
- let data = response.data;
- if (data.flag) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'success',
- message: '备注成功'
- });
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:response.msg});
- }
- }).catch(function (error) {
- console.log(error);
- });
-
- },
- handleChange(file, fileList) {
- this.fileList = fileList.slice(-3);
- },
- showFile(id){
- this.fileData["id"]=id;
- this.showFileFlag = true
- axios.post("/hotel.php/order_main/getFileList", this.fileData).then((response) => {
- let data = response.data;
- if (data.flag) {
- this.fileTable = data.data
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:response.msg});
- }
- }).catch(function (error) {
- console.log(error);
- });
- },
- handleExceed(files, fileList) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'warning',
- message:`当前限制选择 1 个文件`});
- },
- fileSubmit(){
- if (this.fileList.length==0) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:`请选择文件`});
- return false;
- }
- if (this.fileData["name"]=="") {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:`请输入名称标识`});
- return false;
- }
- let file = this.fileList[0].response.data.url;
- this.fileData["file"]=file;
- axios.post("/hotel.php/order_main/addFileInfo", this.fileData).then((response) => {
- let data = response.data;
- if (data.flag) {
- this.fileList=[]
- this.showFile(this.fileData["id"])
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:response.msg});
- }
- }).catch(function (error) {
- console.log(error);
- });
-
- },
- checkSelect(row,index){
- if (this.editOrder.status != 0) {
- return false;
- }
- if (row.receipt_order_id ==0) {
- return true;
- }
- return false;
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- getChannelList(){
- axios.post("/hotel.php/cf_channel_info/getList", this.search).then((response) => {
- console.log(response)
- let data = response.data;
- this.channelList = data.list;
- }).catch(function (error) {
- console.log(error);
- });
- },
- getStatusName(info) {
- for (let i = 0; i < this.status.length; i++) {
- if (this.status[i].id == info.status) {
- return this.status[i].value
- }
- }
- return "-"
- },
- getUserName(info) {
- for (let i = 0; i < this.userList.length; i++) {
- if (this.userList[i].id == info.create_id) {
- return this.userList[i].name
- }
- }
- return "-"
- },
- getOrderMainStatus(info){
- for (let i = 0; i < this.orderMainStatus.length; i++) {
- if (this.orderMainStatus[i].id == info.order_status) {
- return this.orderMainStatus[i].name
- }
- }
- return "-"
- },
- sizeChange(pageSize) {
- this.search.pageSize = pageSize;
- this.getData(this.search.pageNum)
- },
- sizeOrderMainChange(pageSize) {
- this.orderMainListSearch.pageSize = pageSize;
- this.getOrderMainData(this.orderMainListSearch.pageNum)
- },
- //獲取列表
- getData(page) {
- this.search.pageNum = page;
- axios.post("/hotel.php/receipt_order/getList", this.search).then((response) => {
- let data = response.data;
- console.log(this.tableData);
- if (data.flag) {
- this.tableData = data.data.list;
- this.total = data.data.total;
- console.log(this.tableData);
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:response.msg});
- }
- }).catch(function (error) {
- console.log(error);
- });
- },
- getAdminUser() {
- axios.post("/hotel.php/auth/admin/getList", this.search).then((response) => {
- this.userList = response.data.list;
- }).catch(function (error) {
- console.log(error);
- });
- },
- edit(info) {
- if (info == null) {
- this.editType = false;
- this.editData = {
- name: ""
- }
- } else {
- this.editType = true;
- this.editData = {
- id:info.id,
- name: info.name,
- status:info.status
- }
- }
- this.editShow = true;
- },
- editDoing(){
- axios.post("/hotel.php/receipt_order/save", this.editData).then( (response)=> {
- let data = response.data;
- console.log(this.tableData);
- if (data.flag) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'success',
- message:"保存成功"});
- this.editShow = false;
- this.getData(1);
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:data.msg});
- }
- }).catch(function (error) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:"保存失败"});
- console.log(error);
- });
- },
- setStatus(info){
- this.$confirm('确定修改状态?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- axios.post("/hotel.php/receipt_order/setStatus", info).then( (response)=> {
- let data = response.data;
- if (data.flag) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'success',
- message:"保存成功"});
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:data.msg});
- this.getData(this.search.pageNum)
- }
-
- }).catch(function (error) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:"保存失败"});
- console.log(error);
- this.getData(this.search.pageNum)
- });
- }).catch(() => {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'success',
- message:"已取消"});
- this.getData(this.search.pageNum)
- })
-
- },
- editOrderDivShow(info){
- console.log(info);
- this.editOrder = info;
- this.orderMainListSearch.receipt_order_id = info.id;
- this.orderMainList=[];
- this.getOrderMainData(1);
- this.editOrderShow = true;
- },
- getOrderMainData(page){
- this.orderMainListSearch.pageNum = page;
- axios.post("/hotel.php/receipt_order/getOrderMainList", this.orderMainListSearch).then((response) => {
- let data = response.data;
- console.log(this.tableData);
- if (data.flag) {
- this.orderMainList = data.data.list;
- this.orderMainTotal = data.data.total;
- console.log(this.orderMainList);
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:data.msg});
- }
- }).catch(function (error) {
- console.log(error);
- });
- },
- addOrderMain(order_id){
- let param = {
- order_id:order_id,
- id:this.editOrder.id
- }
- axios.post("/hotel.php/receipt_order/addOrderMain", param).then((response) => {
- let data = response.data;
- if (data.flag) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'success',
- message:"保存成功"});
- this.getOrderMainData(this.orderMainListSearch.pageNum)
- this.getData(this.search.pageNum)
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message: data.msg});
- }
- }).catch(function (error) {
- console.log(error);
- });
- },
- addOrderAll(){
- let orderId = "";
- let length = this.multipleSelection.length;
- for (var k = 0; k < length; k++) {
- if (orderId == "") {
- orderId = this.multipleSelection[k].id;
- continue;
- }
- orderId =orderId+","+this.multipleSelection[k].id;
- }
- this.addOrderMain(orderId);
- },
- removeOrderMain(order_id){
- let param = {
- order_id:order_id,
- id:this.editOrder.id
- }
- axios.post("/hotel.php/receipt_order/removeOrderMain", param).then((response) => {
- let data = response.data;
- if (data.flag) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'success',
- message:"移除成功"});
- this.getOrderMainData(this.orderMainListSearch.pageNum)
- this.getData(this.search.pageNum)
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message: data.msg});
- }
- }).catch(function (error) {
- console.log(error);
- });
- },
- delAll(id){
- let param = {
- id:id
- }
- this.$confirm('确定删除采购单?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- axios.post("/hotel.php/receipt_order/delAll", param).then((response) => {
- let data = response.data;
- if (data.flag) {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'success',
- message:"移除成功"});
- this.getData(this.search.pageNum)
- } else {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'error',
- message:data.msg});
- }
- }).catch(function (error) {
- console.log(error);
- });
- }).catch(() => {
- this.$message({
- offset:0,
- showClose:true,duration:1500,
- type: 'success',
- message:"已取消"});
- });
- }
-
- }
- })
- </script>
- <style lang="scss" scoped>
- .upload .el-upload__input {
- display: none !important;
- }
-
- input[type="file"] {
- display: none !important;
- }
- .el-table thead {
- background-color: #5a5e66 !important;
- }
-
- .header-search {
- font-size: 14px;
- font-weight: 900;
- }
-
- body {
- background-color: white;
- }
-
- .table {
- width: 100%;
- font-size: 12px;
- margin-top: 12px;
- background-color: white;
- }
- .el-form-item{
- margin-bottom: 5px !important;
- }
- </style>
- </html>
|