|
|
@@ -3,9 +3,10 @@
|
|
|
<el-col :span="setcol">
|
|
|
<div class="flex-align-center normal-margin">
|
|
|
<slot name="operation"></slot>
|
|
|
- <el-button class="inline-16" size="small" type="primary" @click="drawer = true">{{setcol === 24?'添 加':'取 消'}}</el-button>
|
|
|
+ <el-button :disabled="data.type === '特殊订单'" v-if="data.status === '新建'" class="inline-16" size="small" type="primary" @click="drawer = true">{{setcol === 24?'添 加':'取 消'}}</el-button>
|
|
|
<excel class="inline-16" :tablecols="columnTitle" :param="param" :total="total" :excelTitle="excelTitle"></excel>
|
|
|
</div>
|
|
|
+ <p class="normal-margin" style="font-size: 13px !important;color:red;font-weight: normal">{{data.amount >= freefreightamount?'当前订单免运费':`订单满${tool.formatAmount(freefreightamount,2)}元免运费,当前还差${tool.formatAmount(freefreightamount - data.amount,2)}元`}}</p>
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
:data="tableData"
|
|
|
@@ -256,6 +257,7 @@ export default {
|
|
|
props:['data','type'],
|
|
|
data () {
|
|
|
return {
|
|
|
+ freefreightamount:null,
|
|
|
drawer:false,
|
|
|
setcol:24,
|
|
|
dataRefresh:true,
|
|
|
@@ -286,8 +288,8 @@ export default {
|
|
|
},
|
|
|
computed:{
|
|
|
canUseInput () {
|
|
|
- if (this.data.saler.length === 0) return false
|
|
|
- let salerIsEditPrice = this.data.saler[0].iseditprice
|
|
|
+ if (this.data.saler && this.data.saler.length === 0) return false
|
|
|
+ let salerIsEditPrice = this.data.saler?this.data.saler[0].iseditprice:0
|
|
|
if (this.data.type === '标准订单' && salerIsEditPrice && this.data.status === '新建') {
|
|
|
return true
|
|
|
} else {
|
|
|
@@ -306,6 +308,7 @@ export default {
|
|
|
this.tableData = res.data
|
|
|
this.total = res.total
|
|
|
this.currentPage = res.pageNumber
|
|
|
+ this.queryBasicInfo()
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
// console.log(`每页 ${val} 条`);
|
|
|
@@ -381,12 +384,21 @@ export default {
|
|
|
},
|
|
|
})
|
|
|
},
|
|
|
- async updateOrder (val) {
|
|
|
+ async updateOrder (val,fn) {
|
|
|
const res = await this.$api.requested({
|
|
|
"id": 20221109093602,
|
|
|
"content": val
|
|
|
})
|
|
|
- this.$emit('onSuccess')
|
|
|
+ if (res.code == 1) {
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ fn?fn():''
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type:'error',
|
|
|
+ message:res.data + ':' + res.msg
|
|
|
+ })
|
|
|
+ this.listData()
|
|
|
+ }
|
|
|
},
|
|
|
setPickerOptions (val) {
|
|
|
var startDate = val.deliverydate
|
|
|
@@ -424,33 +436,23 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
inputChange (row,index) {
|
|
|
- console.log(row.defaultprice,Number(row.contractprice))
|
|
|
- if (row.defaultprice < Number(row.contractprice)) {
|
|
|
- this.$message({
|
|
|
- message:'价格不能低于原价!',
|
|
|
- type:'error'
|
|
|
- })
|
|
|
- row.defaultprice = row.contractprice
|
|
|
- this.updateOrder({
|
|
|
- "sa_orderid": this.data.sa_orderid, //订单ID
|
|
|
- "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
- "sa_contractid": this.data.contacts.contactsid, //合同ID
|
|
|
- "type": this.data.type, //订单类型
|
|
|
- "items": this.tableData
|
|
|
- })
|
|
|
- } else {
|
|
|
- // row.defaultprice = row.contractprice
|
|
|
- this.$set(this.tableData,index,row)
|
|
|
- this.updateOrder({
|
|
|
- "sa_orderid": this.data.sa_orderid, //订单ID
|
|
|
- "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
- "sa_contractid": this.data.contacts.contactsid, //合同ID
|
|
|
- "type": this.data.type, //订单类型
|
|
|
- "items": this.tableData
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ this.updateOrder({
|
|
|
+ "sa_orderid": this.data.sa_orderid, //订单ID
|
|
|
+ "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
+ "sa_contractid": this.data.contacts.contactsid, //合同ID
|
|
|
+ "type": this.data.type, //订单类型
|
|
|
+ "items": this.tableData
|
|
|
+ },()=>{
|
|
|
+ this.$set(this.tableData,index,row)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async queryBasicInfo () {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id":20220920084001,"content":{
|
|
|
+ sys_enterpriseid:this.data.sys_enterpriseid
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.freefreightamount = res.data.freefreightamount?res.data.freefreightamount:0
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|