|
@@ -8,49 +8,52 @@
|
|
v-model="isShow"
|
|
v-model="isShow"
|
|
@cancle="isShow=false"
|
|
@cancle="isShow=false"
|
|
:width="800">
|
|
:width="800">
|
|
- <div>
|
|
|
|
- <a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
|
- <div slot="message">此预测单的各项参数信息如下</div>
|
|
|
|
- </a-alert>
|
|
|
|
- <div class="module-cont" v-if="detailData">
|
|
|
|
- <p class="title">产品范围</p>
|
|
|
|
- <a-tag color="blue" style="margin-bottom: 10px;">{{ detailData&&detailData.stockPredictRange==0?'自选产品':'全部产品' }}</a-tag>
|
|
|
|
- <a-table
|
|
|
|
- class="sTable"
|
|
|
|
- ref="table"
|
|
|
|
- size="small"
|
|
|
|
- :rowKey="(record) => record.id"
|
|
|
|
- :columns="columns"
|
|
|
|
- :data-source="loadData"
|
|
|
|
- :loading="loading"
|
|
|
|
- :scroll="{ y: 400 }"
|
|
|
|
- :pagination="false"
|
|
|
|
- bordered>
|
|
|
|
- </a-table>
|
|
|
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
|
+ <div>
|
|
|
|
+ <a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
|
+ <div slot="message">此预测单的各项参数信息如下</div>
|
|
|
|
+ </a-alert>
|
|
|
|
+ <div class="module-cont" v-if="detailData">
|
|
|
|
+ <p class="title">产品范围</p>
|
|
|
|
+ <a-tag color="blue" style="margin-bottom: 10px;">{{ detailData&&detailData.stockPredictRange==0?'自选产品':'全部产品' }}</a-tag>
|
|
|
|
+ <a-table
|
|
|
|
+ class="sTable"
|
|
|
|
+ ref="table"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data-source="loadData"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ :scroll="{ y: 400 }"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ bordered>
|
|
|
|
+ </a-table>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="module-cont">
|
|
|
|
+ <p class="title">销售保障法</p>
|
|
|
|
+ <p class="explain">保障倍数:<span>{{ (detailData&&detailData.saleEnsureNum) || '--' }}</span></p>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="module-cont">
|
|
|
|
+ <p class="title">趋势平均法</p>
|
|
|
|
+ <p class="explain">服务水平:<span>{{ (detailData&&detailData.trendServiceLevel) || '--' }}%(对应的安全系数为{{ (detailData&&detailData.trendSafetyFactor) || '--' }})</span></p>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="spin-cont" v-if="detailData&&detailData.state=='RUN'">
|
|
|
|
+ 按照以上参数设置,系统正在计算中,请耐心等待...
|
|
|
|
+ <a-spin style="margin-left: 15px;" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="btn-cont">
|
|
|
|
+ <a-button type="primary" v-if="detailData&&detailData.state=='FINISH'" id="intelligentReplenishmentDetail-save" @click="handleDownload" style="margin-right: 15px;">结果下载</a-button>
|
|
|
|
+ <a-button id="intelligentReplenishmentDetail-back" @click="isShow = false">关闭</a-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <div class="module-cont">
|
|
|
|
- <p class="title">销售保障法</p>
|
|
|
|
- <p class="explain">保障倍数:<span>{{ (detailData&&detailData.saleEnsureNum) || '--' }}</span></p>
|
|
|
|
- </div>
|
|
|
|
- <div class="module-cont">
|
|
|
|
- <p class="title">趋势平均法</p>
|
|
|
|
- <p class="explain">服务水平:<span>{{ (detailData&&detailData.trendServiceLevel) || '--' }}%(对应的安全系数为{{ (detailData&&detailData.trendSafetyFactor) || '--' }})</span></p>
|
|
|
|
- </div>
|
|
|
|
- <div class="spin-cont" v-if="detailData&&detailData.state=='RUN'">
|
|
|
|
- 按照以上参数设置,系统正在计算中,请耐心等待...
|
|
|
|
- <a-spin style="margin-left: 15px;" />
|
|
|
|
- </div>
|
|
|
|
- <div class="btn-cont">
|
|
|
|
- <!-- <a-button type="primary" id="intelligentReplenishmentDetail-save" @click="handleDownload">结果下载</a-button> -->
|
|
|
|
- <a-button id="intelligentReplenishmentDetail-back" @click="isShow = false">关闭</a-button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ </a-spin>
|
|
</a-modal>
|
|
</a-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import moment from 'moment'
|
|
import { STable } from '@/components'
|
|
import { STable } from '@/components'
|
|
-import { predictDetail, predictRangeList } from '@/api/predict'
|
|
|
|
|
|
+import { predictDetail, predictRangeList, predictstockPredictExport } from '@/api/predict'
|
|
export default {
|
|
export default {
|
|
name: 'IntelligentReplenishmentDetailModal',
|
|
name: 'IntelligentReplenishmentDetailModal',
|
|
components: { STable },
|
|
components: { STable },
|
|
@@ -67,6 +70,7 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
isShow: this.openModal, // 是否打开弹框
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
|
+ spinning: false,
|
|
detailsData: null, // 详情数据
|
|
detailsData: null, // 详情数据
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
@@ -109,12 +113,29 @@ export default {
|
|
},
|
|
},
|
|
// 结果下载
|
|
// 结果下载
|
|
handleDownload () {
|
|
handleDownload () {
|
|
- const params = this.queryParam
|
|
|
|
- this.downloadLoading = true
|
|
|
|
- // stockExport(params).then(res => {
|
|
|
|
- // this.downloadLoading = false
|
|
|
|
- // this.download(res)
|
|
|
|
- // })
|
|
|
|
|
|
+ const _this = this
|
|
|
|
+ const params = {
|
|
|
|
+ sn: (this.detailData && this.detailData.stockPredictSn) || undefined
|
|
|
|
+ }
|
|
|
|
+ _this.downloadLoading = true
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ predictstockPredictExport(params).then(res => {
|
|
|
|
+ _this.downloadLoading = false
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ if (res.type == 'application/json') {
|
|
|
|
+ var reader = new FileReader()
|
|
|
|
+ reader.addEventListener('loadend', function () {
|
|
|
|
+ const obj = JSON.parse(reader.result)
|
|
|
|
+ _this.$notification.error({
|
|
|
|
+ message: '提示',
|
|
|
|
+ description: obj.message
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ reader.readAsText(res)
|
|
|
|
+ } else {
|
|
|
|
+ this.download(res)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
download (data) {
|
|
download (data) {
|
|
if (!data) { return }
|
|
if (!data) { return }
|