Browse Source

收购单优化

dev
nizongfeng 3 years ago
parent
commit
a3d4e224c4
4 changed files with 281 additions and 9 deletions
  1. +2
    -2
      application/admin/service/OrderMainDao.php
  2. +3
    -3
      application/admin/service/ReceiptOrderDao.php
  3. +12
    -0
      application/admin/service/ReceiptOrderService.php
  4. +264
    -4
      application/admin/view/receipt_order/index.html

+ 2
- 2
application/admin/service/OrderMainDao.php View File

@@ -172,7 +172,7 @@ class OrderMainDao
"receipt_order_name"=>$receiptOrder['name']
];
$model = new OrderMain();
$model->save($data,["id"=>$orderIds]);
$model->save($data,["id"=>["in",$orderIds]]);
return Util::returnArrSu();
}catch (Exception $e){
return Util::returnArrEr("添加主订单到采购单下失败".$e->getMessage());
@@ -192,7 +192,7 @@ class OrderMainDao
"receipt_order_name"=>""
];
$model = new OrderMain();
$model->save($data,["id"=>$orderIds]);
$model->save($data,["id"=>["in",$orderIds]]);
return Util::returnArrSu();
}catch (Exception $e){
return Util::returnArrEr("将主订单从采购单下移除失败".$e->getMessage());


+ 3
- 3
application/admin/service/ReceiptOrderDao.php View File

@@ -24,14 +24,14 @@ class ReceiptOrderDao
*/
public function getInfoById($id){
try{
$model = new OrderMain();
$model = new ReceiptOrder();
$info = $model->where(["id"=>$id])->find();
if ($info == null) {
return Util::returnArrEr("获取管理员信息失败:".$id);
return Util::returnArrEr("获取收款单信息失败:".$id);
}
return Util::returnArrSu("",$info->toArray());
}catch (Exception $e){
return Util::returnArrEr("获取管理员信息失败:".$e->getMessage());
return Util::returnArrEr("获取收款单信息失败:".$e->getMessage());
}
}



+ 12
- 0
application/admin/service/ReceiptOrderService.php View File

@@ -112,6 +112,18 @@ class ReceiptOrderService
if (!empty($param['order_id'])) {
$where["order"]=$param['order_id'];
}
if (!empty($param['channel_id'])) {
$where['channel_id'] = $param['channel_id'];
}
if ($param['order_status'] != '') {
$where['order_status'] = $param['order_status'];
}
if (!empty($param['commissioner_id'])) {
$where['commissioner_id'] = $param['commissioner_id'];
}
if (!empty($param['create_id'])) {
$where['create_id'] = $param['create_id'];
}
switch ($param['inReceipt']) {
case 0:
break;


+ 264
- 4
application/admin/view/receipt_order/index.html View File

@@ -31,7 +31,7 @@
<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">
<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>
@@ -46,6 +46,7 @@
<template slot-scope="scope">
<el-button-group>
<el-button type="primary" size="mini" @click="edit(scope.row)" icon="el-icon-edit">编辑</el-button>
<el-button type="primary" size="mini" @click="editOrderDivShow(scope.row)" icon="el-icon-share">订单</el-button>
<el-button type="primary" size="mini" icon="el-icon-delete">删除</el-button>
</el-button-group>
</template>
@@ -95,6 +96,118 @@
</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: 20px">
<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="true">
<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>订单ID:</span>
<el-input v-model="orderMainListSearch.order_id" style="width: 150px;" placeholder="请输入内容"></el-input>
<span>订单状态:</span>
<el-select v-model="orderMainListSearch.order_status" 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;" 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-select v-model="orderMainListSearch.channel_id" style="width: 150px;" 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-select v-model="orderMainListSearch.commissioner_id" style="width: 150px;" 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;" placeholder="请选择" clearable>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<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">
<el-table-column prop="id" label="订单ID" min-width="40" ></el-table-column>
<el-table-column prop="commissioner" label="专员" min-width="40" :formatter="getUserName"></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="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="操作" >
<template slot-scope="scope">
<el-button-group>
<el-button type="primary" size="mini" v-if="scope.row.receipt_order_id==0" @click="addOrderMain(scope.row.id)" icon="el-icon-edit">添加</el-button>
<el-button type="primary" size="mini" v-if="scope.row.receipt_order_id==editOrder.id" @click="removeOrderMain(scope.row.id)" icon="el-icon-delete">移除</el-button>
</el-button-group>
</template>
</el-table-column>

</el-table>
<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>
</div>
</body>
<!-- import Vue before Element -->
@@ -130,22 +243,64 @@
},
editShow: false,
editType: false,
editData: {}
editData: {},
editOrderShow:false,
editOrderOld:{},
editOrder:{},
orderMainListSearch:{
"receipt_order_id":0,
"inReceipt":0,
"order_id":"",
"channel_id":"",
"order_status":"",
"commissioner_id":"",
"create_id":"",
"pageNum":1,
"pageSize":10
},
orderMainTotal:0,
orderMainList:[],
inReceipt:[
{id:0,name:"所有"},
{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:[]
}
},
created() {
this.getAdminUser();
this.getChannelList();
this.getData(1)

},
methods: {
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 "未知"
return "-"
},
getUserName(info) {
for (let i = 0; i < this.userList.length; i++) {
@@ -153,12 +308,24 @@
return this.userList[i].name
}
}
return "未知"
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;
@@ -217,7 +384,100 @@
this.$message.error("保存失败");
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({
message: '设置成功!',
type: 'success'
});
} else {
this.$message.error(response.msg);
}
}).catch(function (error) {
this.$message.error("保存失败");
console.log(error);
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});

},
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.error(response.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({
message: '添加成功!',
type: 'success'
});
this.getOrderMainData(this.orderMainListSearch.pageNum)
} else {
this.$message.error(response.msg);
}
}).catch(function (error) {
console.log(error);
});
},
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({
message: '移除成功!',
type: 'success'
});
this.getOrderMainData(this.orderMainListSearch.pageNum)
} else {
this.$message.error(response.msg);
}
}).catch(function (error) {
console.log(error);
});
}

}
})
</script>


Loading…
Cancel
Save