|
@@ -10,9 +10,9 @@
|
|
|
<div slot="title">
|
|
|
<div class="flex-align-center">
|
|
|
<p><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥ {{tool.formatAmount(data.amount,2)}}</b></span></p>
|
|
|
- <!-- <label style="font-size:14px;margin-left:10px" for="">备注:</label>
|
|
|
- <input class="order__note__input" v-model="defaultData.remarks" type="text" placeholder="请输入订单备注"> -->
|
|
|
- <p>运费:{{data.amount > data.freefreightamount >= 0?'当前订单免运费':`订单满${data.freefreightamount}元免运费,当前还差${data.freefreightamount - data.amount}元`}}</p>
|
|
|
+ </div>
|
|
|
+ <div class="flex-align-center">
|
|
|
+ <p style="font-size: 13px !important;color: #8888;font-weight: normal">{{data.amount > freefreightamount?'当前订单免运费':`订单满${freefreightamount}元免运费,当前还差${freefreightamount - data.amount}元`}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="drawer__panel">
|
|
@@ -43,14 +43,14 @@
|
|
|
<div class="flex-align-center">
|
|
|
<p class="inline-16"><small>账户余额: </small><b>¥{{tool.formatAmount(defaultData.accountclass.balance?defaultData.accountclass.balance:0,2)}}</b></p>
|
|
|
<p class="inline-16"><small>账户名称: </small>{{defaultData.accountclass.accountname?defaultData.accountclass.accountname:'未选择账户'}}</p>
|
|
|
- <p><small>本单金额: </small>{{tool.formatAmount(data.amount - rebateamount,2)}}</p>
|
|
|
+ <p><small>本单金额: </small>{{data.rebate_used ? tool.formatAmount(data.defaultamount - rebateamount,2) : data.defaultamount}}</p>
|
|
|
</div>
|
|
|
<div v-if="(data.type === '标准订单' || data.type === '特殊订单') && isusedrebate === 1">
|
|
|
<el-checkbox v-model="checked" :true-label="1" :false-label="0">使用返利金</el-checkbox>
|
|
|
<div v-if="checked" class="flex-align-center">
|
|
|
<p class="inline-16"><b>返利金余额:{{tool.formatAmount(defaultData.rebatebalance,2)}}</b></p>
|
|
|
- <el-input class="inline-16" size="mini" style="width:150px" v-model="rebateamount" @blur="useRebate" placeholder="输入使用金额"></el-input>
|
|
|
- <small>(返利金最高使用比例{{data.order_rebate_userate}}%,本单上限:{{tool.formatAmount(data.amount * data.order_rebate_userate / 100,2)}})</small>
|
|
|
+ <el-input class="inline-16" size="mini" style="width:150px" v-model="rebateamount" @blur="useRebate(data.rebateamount)" placeholder="输入使用金额"></el-input>
|
|
|
+ <small>(返利金最高使用比例{{data.order_rebate_userate}})</small>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -192,15 +192,15 @@
|
|
|
<div class="mt-10">
|
|
|
<div>
|
|
|
<p class="normal-title inline-16">订单产品</p>
|
|
|
- <el-button type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button>
|
|
|
+ <!-- <el-button type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button> -->
|
|
|
</div>
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="setcol">
|
|
|
<product-list ref="prolist" :data="data" :type="'edit'" @onSuccess="onEditSuccess"></product-list>
|
|
|
</el-col>
|
|
|
- <el-col :span="24 - setcol">
|
|
|
+ <!-- <el-col :span="24 - setcol">
|
|
|
<add-product ref="addpro" :data="data" @onConfirm="onConfirm"></add-product>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -234,6 +234,7 @@ export default {
|
|
|
inject:['thisDetail'],
|
|
|
data () {
|
|
|
return {
|
|
|
+ freefreightamount:'',
|
|
|
checked:0,
|
|
|
visible:false,
|
|
|
visible1:false,
|
|
@@ -262,14 +263,24 @@ export default {
|
|
|
signbackstatus:'不需要',
|
|
|
saletype:"",
|
|
|
saler_name:"",
|
|
|
- billdate:''
|
|
|
+ billdate:'',
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
console.log(this.data);
|
|
|
-
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.queryBasicInfo()
|
|
|
},
|
|
|
methods:{
|
|
|
+ async queryBasicInfo () {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id":20220920084001,"content":{},
|
|
|
+ })
|
|
|
+ this.freefreightamount = res.data.freefreightamount
|
|
|
+ console.log(res.data);
|
|
|
+
|
|
|
+ },
|
|
|
onShow () {
|
|
|
this.initPage()
|
|
|
},
|
|
@@ -345,67 +356,45 @@ export default {
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
this.$emit('onSuccess')
|
|
|
if (this.data.type === '标准订单' || this.data.type === '特殊订单') {
|
|
|
- this.isusedrebate === 1?this.useRebate():""
|
|
|
+ this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
|
|
|
}
|
|
|
|
|
|
this.drawer = false
|
|
|
})
|
|
|
},
|
|
|
onEditSuccess () {
|
|
|
- this.$refs.addpro.listData()
|
|
|
+ // this.$refs.addpro.listData()
|
|
|
+ this.$emit('onSuccess')
|
|
|
},
|
|
|
addMoreProduct () {
|
|
|
this.setcol === 12?this.setcol = 24 : this.setcol = 12
|
|
|
},
|
|
|
- // 订单添加商品
|
|
|
- async onConfirm (data) {
|
|
|
- const res = await this.$api.requested({
|
|
|
- "id": 20221109093602,
|
|
|
- "content": {
|
|
|
- "sa_orderid": this.$route.query.id, //订单ID
|
|
|
- "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
- "type":this.data.type, //订单类型
|
|
|
- "items": data.map(e=>{
|
|
|
- return {
|
|
|
- sa_orderitemsid:0,
|
|
|
- itemid:e.itemid,
|
|
|
- qty:e.orderminqty,
|
|
|
- needdate:e.deliverydate
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- })
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
- this.setcol = 24
|
|
|
- this.$refs['prolist'].listData()
|
|
|
- // this.$emit('onSuccess')
|
|
|
- })
|
|
|
- },
|
|
|
- async useRebate () {
|
|
|
+ async useRebate (e) {
|
|
|
let that = this
|
|
|
- if (this.rebateamount > this.defaultData.rebatebalance ||this.rebateamount > (this.data.amount * this.data.order_rebate_userate / 100) ) return this.$message({
|
|
|
- message:`余额不足或已超过可用上限!`,
|
|
|
- type:function () {
|
|
|
- that.rebateamount = 0
|
|
|
- return 'error'
|
|
|
- }()
|
|
|
- })
|
|
|
- if (this.rebateamount == null) return this.$message({
|
|
|
- message:"返利金不能为空",
|
|
|
- type:'error'
|
|
|
- })
|
|
|
+ /* 修改返利金 */
|
|
|
+ let rebateamount = e;
|
|
|
+ let amount = this.data.order_rebate_userate * this.data.defaultamount;//最大可用金额
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20230218225002,
|
|
|
- "content": {
|
|
|
- "sa_orderid": this.data.sa_orderid, //订单金额
|
|
|
- "isused": this.checked, //是否使用
|
|
|
- "rebateamount": this.rebateamount //返利金使用金额
|
|
|
- },
|
|
|
- })
|
|
|
- if (res.code === 0) this.$message({
|
|
|
- message:`使用返利金失败!${res.msg}`,
|
|
|
- type:'error'
|
|
|
- })
|
|
|
+ "id":20230218225002,
|
|
|
+ "content":{
|
|
|
+ "sa_orderid":this.data.sa_orderid,//订单金额
|
|
|
+ "isused":1,//是否使用
|
|
|
+ "rebateamount":rebateamount>amount?amount:rebateamount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(res.data=='成功'){
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ this.initPage()
|
|
|
+ if(rebateamount>amount){
|
|
|
+ this.data.rebateamount=amount
|
|
|
+ this.$message({
|
|
|
+ message: '返利金最大可用值'+ amount,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
},
|
|
|
// 查询站点是否使用返利金
|
|
|
async queryUsedrebate () {
|