|
|
@ -179,68 +179,68 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapActions } from "vuex"; |
|
|
|
import { prcCollectionListForGov } from "@/api/zdyf"; |
|
|
|
import { mapActions } from 'vuex' |
|
|
|
import { prcCollectionListForGov } from '@/api/zdyf' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
shichangList: [ |
|
|
|
{ |
|
|
|
name: "豌豆荚", |
|
|
|
name: '豌豆荚', |
|
|
|
num: 14, |
|
|
|
jzr: 1, |
|
|
|
jzr: 1 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "白玉菇", |
|
|
|
name: '白玉菇', |
|
|
|
num: 14, |
|
|
|
jzr: 1, |
|
|
|
jzr: 1 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "生菜球", |
|
|
|
name: '生菜球', |
|
|
|
num: 14, |
|
|
|
jzr: -1, |
|
|
|
jzr: -1 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "秋葵", |
|
|
|
name: '秋葵', |
|
|
|
num: 14, |
|
|
|
jzr: -1, |
|
|
|
jzr: -1 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "苦菊", |
|
|
|
name: '苦菊', |
|
|
|
num: 14, |
|
|
|
jzr: 1, |
|
|
|
jzr: 1 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "白菜", |
|
|
|
name: '白菜', |
|
|
|
num: 14, |
|
|
|
jzr: 1, |
|
|
|
}, |
|
|
|
jzr: 1 |
|
|
|
} |
|
|
|
], |
|
|
|
yfclzList: [ |
|
|
|
{ |
|
|
|
name: "豌豆荚", |
|
|
|
num: 460, |
|
|
|
name: '豌豆荚', |
|
|
|
num: 460 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "白玉菇", |
|
|
|
num: 389, |
|
|
|
name: '白玉菇', |
|
|
|
num: 389 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "生菜球", |
|
|
|
num: 322, |
|
|
|
name: '生菜球', |
|
|
|
num: 322 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "秋葵", |
|
|
|
num: 266, |
|
|
|
name: '秋葵', |
|
|
|
num: 266 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "苦菊", |
|
|
|
num: 198, |
|
|
|
name: '苦菊', |
|
|
|
num: 198 |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "白菜", |
|
|
|
num: 890, |
|
|
|
}, |
|
|
|
name: '白菜', |
|
|
|
num: 890 |
|
|
|
} |
|
|
|
], |
|
|
|
optionHover1: { |
|
|
|
step: 0.5, // 数值越大速度滚动越快 |
|
|
@ -250,84 +250,102 @@ export default { |
|
|
|
openWatch: true, // 开启数据实时监控刷新dom |
|
|
|
singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1 |
|
|
|
singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3 |
|
|
|
waitTime: 2000, // 单步运动停止的时间(默认值1000ms) |
|
|
|
waitTime: 2000 // 单步运动停止的时间(默认值1000ms) |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
const params = { |
|
|
|
params: { |
|
|
|
Country: 0, |
|
|
|
FEndDate: this.$moment().format("yyyy-MM-DD"), |
|
|
|
FEndDate: this.$moment().format('yyyy-MM-DD'), |
|
|
|
FParentPartyID: 1, |
|
|
|
FPartyName: "青岛移风蔬菜批发市场有限公司", |
|
|
|
FPartyName: '青岛移风蔬菜批发市场有限公司', |
|
|
|
FPartyType: 1010, |
|
|
|
FStartDate: this.$moment().format("yyyy-MM-DD"), |
|
|
|
FStartDate: this.$moment().format('yyyy-MM-DD'), |
|
|
|
FStoreId: 1, |
|
|
|
Name: "全部", |
|
|
|
Name: '全部', |
|
|
|
page: 1, |
|
|
|
pageSize: 10, |
|
|
|
singletype: 0, |
|
|
|
sort: "", |
|
|
|
}; |
|
|
|
prcCollectionListForGov(params).then((res) => { |
|
|
|
if (res.priceslist.length > 0) { |
|
|
|
prcCollectionListForGov({ |
|
|
|
...params, |
|
|
|
FEndDate: this.$moment().subtract(1, "days").format("yyyy-MM-DD"), |
|
|
|
FStartDate: this.$moment().subtract(1, "days").format("yyyy-MM-DD"), |
|
|
|
}).then((res1) => { |
|
|
|
if (res1.priceslist.length > 0) { |
|
|
|
this.shichangList = this.getScData(res.priceslist, res1.priceslist); |
|
|
|
} else { |
|
|
|
this.shichangList = []; |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.shichangList = []; |
|
|
|
sort: '' |
|
|
|
}, |
|
|
|
times: this.$moment().subtract(1, 'days').format('yyyy-MM-DD'), |
|
|
|
dayList: [], |
|
|
|
tDayList: [] |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
created () { |
|
|
|
this.getDayScData() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
...mapActions({ |
|
|
|
showGlobalDialog: "showGlobalDialog", |
|
|
|
set_yfcj: "SET_YFCJ", |
|
|
|
set_yfclz: "SET_YFCLZ", |
|
|
|
set_ldhg: "SET_LDGH", |
|
|
|
showGlobalDialog: 'showGlobalDialog', |
|
|
|
set_yfcj: 'SET_YFCJ', |
|
|
|
set_yfclz: 'SET_YFCLZ', |
|
|
|
set_ldhg: 'SET_LDGH' |
|
|
|
}), |
|
|
|
openClz() { |
|
|
|
this.set_yfclz(true); |
|
|
|
openClz () { |
|
|
|
this.set_yfclz(true) |
|
|
|
}, |
|
|
|
deduplicationJs(arr) { |
|
|
|
const data = []; |
|
|
|
deduplicationJs (arr) { |
|
|
|
const data = [] |
|
|
|
arr.forEach((item, index) => { |
|
|
|
if ((index + 1) % 2 === 0) { |
|
|
|
const num = (arr[index - 1].AvgPrice + item.AvgPrice) / 2; |
|
|
|
data.push({ ...item, price: num }); |
|
|
|
const num = (arr[index - 1].AvgPrice + item.AvgPrice) / 2 |
|
|
|
data.push({ ...item, price: num }) |
|
|
|
} |
|
|
|
}); |
|
|
|
return data; |
|
|
|
}) |
|
|
|
return data |
|
|
|
}, |
|
|
|
getScData(arr, arr1) { |
|
|
|
const dataD = this.deduplicationJs(arr); |
|
|
|
const dataTd = this.deduplicationJs(arr1); |
|
|
|
getDayScData (data) { |
|
|
|
prcCollectionListForGov({ ...this.params, ...data }).then((res) => { |
|
|
|
if (res.priceslist.length > 0) { |
|
|
|
this.dayList = res.priceslist |
|
|
|
this.getDayScTData() |
|
|
|
} else { |
|
|
|
this.times = this.$moment(this.times).subtract(1, 'days').format('yyyy-MM-DD') |
|
|
|
this.getDayScData({ |
|
|
|
FEndDate: this.$moment().subtract(1, 'days').format('yyyy-MM-DD'), |
|
|
|
FStartDate: this.$moment().subtract(1, 'days').format('yyyy-MM-DD') |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getDayScTData () { |
|
|
|
prcCollectionListForGov({ |
|
|
|
...this.params, |
|
|
|
FEndDate: this.times, |
|
|
|
FStartDate: this.times |
|
|
|
}).then((res1) => { |
|
|
|
if (res1.priceslist.length > 0) { |
|
|
|
this.shichangList = this.getScData( |
|
|
|
this.dayList, |
|
|
|
res1.priceslist |
|
|
|
) |
|
|
|
} else { |
|
|
|
this.times = this.$moment(this.times).subtract(1, 'days').format('yyyy-MM-DD') |
|
|
|
this.getDayScTData() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getScData (arr, arr1) { |
|
|
|
const dataD = this.deduplicationJs(arr) |
|
|
|
const dataTd = this.deduplicationJs(arr1) |
|
|
|
return dataD.map((item, index) => { |
|
|
|
const priceTd = dataTd.filter((item1) => item.Name === item1.Name)[0] |
|
|
|
.price; |
|
|
|
const jzrPrice = item.price - priceTd; |
|
|
|
.price |
|
|
|
const jzrPrice = item.price - priceTd |
|
|
|
return { |
|
|
|
...item, |
|
|
|
jzrPrice, |
|
|
|
}; |
|
|
|
}); |
|
|
|
}, |
|
|
|
handelClickEmap() { |
|
|
|
this.$EventBus.$emit("switcMapType", "Emap"); |
|
|
|
jzrPrice |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handelClickEmap () { |
|
|
|
this.$EventBus.$emit('switcMapType', 'Emap') |
|
|
|
} |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
computed: {}, |
|
|
|
watch: {}, |
|
|
|
}; |
|
|
|
watch: {} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|