|
|
|
@ -78,7 +78,7 @@ |
|
|
|
<view class="submit-contant-time"> |
|
|
|
<view class=""> |
|
|
|
<text class="submit-contant-time-title">有效时间:</text> |
|
|
|
<text class="submit-contant-time-title">{{ upDataObj.createTime }}</text> |
|
|
|
<text class="submit-contant-time-title">{{ upDataObj.enquiryValidTime }}</text> |
|
|
|
</view> |
|
|
|
<view class="" @click="resetTime()"><text class="submit-contant-time-subtitle">设置</text></view> |
|
|
|
</view> |
|
|
|
@ -194,7 +194,7 @@ |
|
|
|
<view class="item submit-check-text" v-for="(item, index) in years" :key="index">{{ item }}</view> |
|
|
|
</picker-view-column> |
|
|
|
<picker-view-column> |
|
|
|
<view class="item submit-check-text" v-for="(item, index) in months" :key="index">{{ item }}分钟</view> |
|
|
|
<view class="item submit-check-text" v-for="(item, index) in months" :key="index">{{ item }}</view> |
|
|
|
</picker-view-column> |
|
|
|
</picker-view> |
|
|
|
</view> |
|
|
|
@ -221,11 +221,11 @@ export default { |
|
|
|
const months = [] |
|
|
|
const month = date.getMonth() + 1 |
|
|
|
const day = date.getDate() |
|
|
|
for (let i = 1; i < 49; i++) { |
|
|
|
years.push(i + '小时') |
|
|
|
for (let i = 1; i < 3; i++) { |
|
|
|
years.push(i + '天') |
|
|
|
} |
|
|
|
for (let i = 1; i < 61; i++) { |
|
|
|
months.push(i) |
|
|
|
for (let i = 1; i < 24; i++) { |
|
|
|
months.push(i + '小时') |
|
|
|
} |
|
|
|
return { |
|
|
|
value: '', |
|
|
|
@ -241,16 +241,16 @@ export default { |
|
|
|
timeValue: [0, 0], |
|
|
|
pickerValue: [], |
|
|
|
upDataObj: { |
|
|
|
otherFee:0, |
|
|
|
totalAllPrice:0, |
|
|
|
enquiryValidTimeSplit:[] |
|
|
|
otherFee: 0, |
|
|
|
totalAllPrice: 0, |
|
|
|
enquiryValidTimeSplit: [] |
|
|
|
}, |
|
|
|
addObj: {}, |
|
|
|
prices: { |
|
|
|
totalPrice: 0 |
|
|
|
}, |
|
|
|
modifyIndex: 0, |
|
|
|
pricesIndex: 0, |
|
|
|
pricesIndex: 0 |
|
|
|
// items: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -270,10 +270,9 @@ export default { |
|
|
|
this.upDataObj = res |
|
|
|
var timeb = this.upDataObj.enquiryValidTime.split(' ') |
|
|
|
var timeabs = timeb[1].split(':') |
|
|
|
console.log('timeabs',timeabs) |
|
|
|
this.$set(this.upDataObj,'enquiryValidTimeSplit',timeabs) |
|
|
|
this.$set(this.upDataObj,'otherFee',0) |
|
|
|
this.$set(this.upDataObj,'totalAllPrice',0) |
|
|
|
this.$set(this.upDataObj, 'enquiryValidTimeSplit', timeabs) |
|
|
|
this.$set(this.upDataObj, 'otherFee', 0) |
|
|
|
this.$set(this.upDataObj, 'totalAllPrice', 0) |
|
|
|
console.log('this.upDataObj', res) |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -329,8 +328,40 @@ export default { |
|
|
|
}, |
|
|
|
// 时间设置确认 |
|
|
|
pickerSure() { |
|
|
|
console.log('timeValue',this.timeValue) |
|
|
|
console.log('timeValue', this.timeValue) |
|
|
|
this.$refs.popupTime.close() |
|
|
|
var abs = this.addDate(new Date(), this.timeValue[0] + 1,this.timeValue[1] + 1) |
|
|
|
var timeb = abs.split(' ') |
|
|
|
var timeabs = timeb[1].split(':') |
|
|
|
this.$set(this.upDataObj, 'enquiryValidTimeSplit', timeabs) |
|
|
|
this.$set(this.upDataObj, 'enquiryValidTime', abs) |
|
|
|
console.log(abs) |
|
|
|
}, |
|
|
|
addDate(date, days,hours) { |
|
|
|
if (days == undefined || days == '') { |
|
|
|
days = 1 |
|
|
|
} |
|
|
|
var date = new Date(date) |
|
|
|
date.setDate(date.getDate() + days) |
|
|
|
date.setHours(date.getHours()+ hours); |
|
|
|
var month = date.getMonth() + 1 |
|
|
|
var day = date.getDate() |
|
|
|
var hours = date.getHours() |
|
|
|
var min = date.getMinutes() |
|
|
|
var second = date.getSeconds() |
|
|
|
return date.getFullYear() + '-' + this.getFormatDate(month) + '-' + this.getFormatDate(day) +' ' + this.getFormatDate(hours) +':' + this.getFormatDate(min)+':' +this.getFormatDate(second) |
|
|
|
}, |
|
|
|
getFormatDate(arg) { |
|
|
|
if (arg == undefined || arg == '') { |
|
|
|
return '' |
|
|
|
} |
|
|
|
|
|
|
|
var re = arg + '' |
|
|
|
if (re.length < 2) { |
|
|
|
re = '0' + re |
|
|
|
} |
|
|
|
|
|
|
|
return re |
|
|
|
}, |
|
|
|
// 确认修改纸品 |
|
|
|
sureModifyPaper() { |
|
|
|
@ -348,38 +379,38 @@ export default { |
|
|
|
pricesSure() { |
|
|
|
this.$set(this.upDataObj.itemList[this.pricesIndex], 'otherFee', this.prices.otherFee) |
|
|
|
this.$set(this.upDataObj.itemList[this.pricesIndex], 'unitFee', this.prices.unitFee) |
|
|
|
var abs = parseFloat(this.prices.gramWeight) * parseFloat(this.prices.unitFee) |
|
|
|
var abs = parseFloat(this.prices.gramWeight) * parseFloat(this.prices.unitFee) |
|
|
|
this.$set(this.upDataObj.itemList[this.pricesIndex], 'totalPrice', abs.toFixed(2)) |
|
|
|
this.upDataObj = JSON.parse(JSON.stringify(this.upDataObj)) |
|
|
|
this.$refs.popupPrice.close() |
|
|
|
console.log(this.upDataObj.itemList) |
|
|
|
this.priceFree() |
|
|
|
}, |
|
|
|
priceFree(){ |
|
|
|
for(let i = 0;i<this.upDataObj.itemList.length;i++){ |
|
|
|
var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat( this.upDataObj.itemList[i].totalPrice) |
|
|
|
priceFree() { |
|
|
|
for (let i = 0; i < this.upDataObj.itemList.length; i++) { |
|
|
|
var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(this.upDataObj.itemList[i].totalPrice) |
|
|
|
this.upDataObj.totalAllPrice = totalAllPrice.toFixed(2) |
|
|
|
var otherFee= parseFloat(this.upDataObj.otherFee) + parseFloat( this.upDataObj.itemList[i].otherFee) |
|
|
|
this.upDataObj.otherFee = otherFee.toFixed(2) |
|
|
|
var otherFee = parseFloat(this.upDataObj.otherFee) + parseFloat(this.upDataObj.itemList[i].otherFee) |
|
|
|
this.upDataObj.otherFee = otherFee.toFixed(2) |
|
|
|
} |
|
|
|
}, |
|
|
|
//提交报价 |
|
|
|
updataQuery() { |
|
|
|
var params = { |
|
|
|
...this.upDataObj |
|
|
|
...this.upDataObj, |
|
|
|
userId: this.$store.state.userInfo.userId |
|
|
|
} |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
updataEnquiryReply( params ) |
|
|
|
updataEnquiryReply(params) |
|
|
|
.then(res => { |
|
|
|
if (res) { |
|
|
|
uni.showToast({ |
|
|
|
title: '添加成功', |
|
|
|
icon: 'success' |
|
|
|
}) |
|
|
|
setTimeout(()=>{ |
|
|
|
back() |
|
|
|
},800) |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
back() |
|
|
|
}, 800) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
|