Browse Source

收款单优化

dev
nizongfeng 3 years ago
parent
commit
6058149328
2 changed files with 44 additions and 10 deletions
  1. +32
    -0
      application/admin/service/ReceiptOrderDao.php
  2. +12
    -10
      application/admin/view/receipt_order/index.html

+ 32
- 0
application/admin/service/ReceiptOrderDao.php View File

@@ -42,12 +42,18 @@ class ReceiptOrderDao
*/
public function save($param)
{
if ($this->checkName($param)) {
return Util::returnArrEr("名称已经存在");
}
try {
$data = [
'name' => $param['name'],
"create_id"=>$param['create_id'],
"group_id"=>$param['group_id']
];
if (isset($param['status'])) {
$data['status'] = $param['status'];
}
$receiptOrder = new ReceiptOrder();
if (empty($param['id'])) {
$id = $receiptOrder->insertGetId($data);
@@ -62,6 +68,32 @@ class ReceiptOrderDao
}

/**
* 校验名称
* @param $param
* @return bool
*/
public function checkName($param):bool {
try {
$model = new ReceiptOrder();
$infoRe = $model->where(["name" => $param['name']])->find();
if ($infoRe == null) {
return false;
}
$info = $infoRe->toArray();
if (isset($param['id'])) {
if ($param['id'] != $info['id']) {
return true;
}
}else{
return true;
}
return false;
} catch (Exception $e) {
return false;
}
}

/**
* 修改状态
* @param $id
* @param $status


+ 12
- 10
application/admin/view/receipt_order/index.html View File

@@ -197,7 +197,7 @@
<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" :formatter="getUserName"></el-table-column>
<el-table-column prop="commissioner_id" 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>
@@ -211,8 +211,8 @@
<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 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="primary" 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>
@@ -274,7 +274,6 @@
editType: false,
editData: {},
editOrderShow:false,
editOrderOld:{},
editOrder:{},
orderMainListSearch:{
"receipt_order_id":"",
@@ -321,6 +320,9 @@
},
methods: {
checkSelect(row,index){
if (this.editOrder.status != 0) {
return false;
}
if (row.receipt_order_id ==0) {
return true;
}
@@ -422,7 +424,7 @@
this.editShow = false;
this.getData(1);
} else {
this.$message.error(response.msg);
this.$message.error(data.msg);
}
}).catch(function (error) {
this.$message.error("保存失败");
@@ -443,7 +445,7 @@
type: 'success'
});
} else {
this.$message.error(response.msg);
this.$message.error(data.msg);
}
}).catch(function (error) {
this.$message.error("保存失败");
@@ -478,7 +480,7 @@
this.orderMainTotal = data.data.total;
console.log(this.orderMainList);
} else {
this.$message.error(response.msg);
this.$message.error(data.msg);
}
}).catch(function (error) {
console.log(error);
@@ -499,7 +501,7 @@
this.getOrderMainData(this.orderMainListSearch.pageNum)
this.getData(this.search.pageNum)
} else {
this.$message.error(response.msg);
this.$message.error(data.msg);
}
}).catch(function (error) {
console.log(error);
@@ -532,7 +534,7 @@
this.getOrderMainData(this.orderMainListSearch.pageNum)
this.getData(this.search.pageNum)
} else {
this.$message.error(response.msg);
this.$message.error(data.msg);
}
}).catch(function (error) {
console.log(error);
@@ -556,7 +558,7 @@
});
this.getData(this.search.pageNum)
} else {
this.$message.error(response.msg);
this.$message.error(data.msg);
}
}).catch(function (error) {
console.log(error);


Loading…
Cancel
Save