|
@@ -58,7 +58,6 @@
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:dataSource="dataSource"
|
|
:dataSource="dataSource"
|
|
:pagination="ipagination"
|
|
:pagination="ipagination"
|
|
- :loading="loading"
|
|
|
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
|
class="j-table-force-nowrap"
|
|
class="j-table-force-nowrap"
|
|
@change="handleTableChange">
|
|
@change="handleTableChange">
|
|
@@ -70,7 +69,7 @@
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
|
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
|
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
|
</template>
|
|
</template>
|
|
- <template slot="fileSlot" slot-scope="text">
|
|
|
|
|
|
+ <template slot="fileSlot" slot-scope="text, record" >
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
|
<a-button
|
|
<a-button
|
|
v-else
|
|
v-else
|
|
@@ -80,14 +79,14 @@
|
|
size="small"
|
|
size="small"
|
|
@click="downloadFile(text)">
|
|
@click="downloadFile(text)">
|
|
下载
|
|
下载
|
|
- <span v-if="text" style="color: #13CE66;">({{text ? "已解析" : "未解析"}})</span>
|
|
|
|
- <span v-else style="color: #E6A23C;">({{text ? "已解析" : "未解析"}})</span>
|
|
|
|
|
|
+ <span v-if="record.analysisState" style="color: #13CE66;">(已解析)</span>
|
|
|
|
+ <span v-else style="color: #E6A23C;">(未解析)</span>
|
|
</a-button>
|
|
</a-button>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <span slot="action" slot-scope="text, record" >
|
|
|
|
|
|
+ <span slot="action" slot-scope="text, record">
|
|
<a @click="handleEdit(record)">编辑</a>
|
|
<a @click="handleEdit(record)">编辑</a>
|
|
|
|
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
@@ -99,16 +98,16 @@
|
|
</a-popconfirm>
|
|
</a-popconfirm>
|
|
|
|
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
- <a @click="handleAnalysis(record.id)" >解析</a>
|
|
|
|
|
|
+ <a-button type="link" size="small" @click="handleAnalysis(record.id)" :loading="analysisLoading">解析</a-button>
|
|
|
|
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
- <a @click="handleReport(record.id)">生成报告</a>
|
|
|
|
|
|
+ <a-button type="link" size="small" @click="handleReport(record)">生成报告</a-button>
|
|
|
|
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
- <a @click="handleEmal(record.id)">
|
|
|
|
|
|
+ <a-button type="link" size="small" @click="handleEmal(record.id)" :loading="emailLoading">
|
|
<span v-if="record.sendState === 1">重新发送</span>
|
|
<span v-if="record.sendState === 1">重新发送</span>
|
|
<span v-else>发送邮件</span>
|
|
<span v-else>发送邮件</span>
|
|
- </a>
|
|
|
|
|
|
+ </a-button>
|
|
</span>
|
|
</span>
|
|
|
|
|
|
</a-table>
|
|
</a-table>
|
|
@@ -135,6 +134,8 @@
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
description: '生产计划管理页面',
|
|
description: '生产计划管理页面',
|
|
|
|
+ analysisLoading: false,
|
|
|
|
+ emailLoading: false,
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
@@ -165,8 +166,21 @@
|
|
title:'发件状态',
|
|
title:'发件状态',
|
|
align:"center",
|
|
align:"center",
|
|
dataIndex: 'sendState',
|
|
dataIndex: 'sendState',
|
|
- customRender:function (text) {
|
|
|
|
- return text === 1 ? "已发送" : "未发送"
|
|
|
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
|
+ let that = this;
|
|
|
|
+ const child = that.$createElement('span', {
|
|
|
|
+ style: {
|
|
|
|
+ color: t ? "#13CE66" : "#E6A23C"
|
|
|
|
+ },
|
|
|
|
+ domProps: {
|
|
|
|
+ innerHTML: t ? "已发送" : "未发送"
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ const obj = {
|
|
|
|
+ children: child,
|
|
|
|
+ attrs: {}
|
|
|
|
+ }
|
|
|
|
+ return obj;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -230,7 +244,10 @@
|
|
},
|
|
},
|
|
handleAnalysis: function (id) {
|
|
handleAnalysis: function (id) {
|
|
var that = this;
|
|
var that = this;
|
|
|
|
+ that.analysisLoading = true;
|
|
getAction(that.url.analysis, {id: id}).then((res) => {
|
|
getAction(that.url.analysis, {id: id}).then((res) => {
|
|
|
|
+ that.analysisLoading = false;
|
|
|
|
+ this.searchQuery()
|
|
if (res.success) {
|
|
if (res.success) {
|
|
that.$message.success(res.message);
|
|
that.$message.success(res.message);
|
|
} else {
|
|
} else {
|
|
@@ -238,15 +255,15 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- handleReport(id){
|
|
|
|
- let fileName = "导出文件"
|
|
|
|
|
|
+ handleReport(record){
|
|
|
|
+ let fileName = "生产异常报告"
|
|
let pie = this.pieChart.getDataURL({
|
|
let pie = this.pieChart.getDataURL({
|
|
type: 'png',
|
|
type: 'png',
|
|
pixelRatio: 2, // 设置像素比,提高清晰度
|
|
pixelRatio: 2, // 设置像素比,提高清晰度
|
|
backgroundColor: '#fff' // 设置背景色
|
|
backgroundColor: '#fff' // 设置背景色
|
|
}).replace(/^data:image\/\w+;base64,/, '')
|
|
}).replace(/^data:image\/\w+;base64,/, '')
|
|
|
|
|
|
- downFile(this.url.report,{id: id,pie:pie},"POST").then((data)=>{
|
|
|
|
|
|
+ downFile(this.url.report,{id: record.id,pie:pie},"POST").then((data)=>{
|
|
if (!data) {
|
|
if (!data) {
|
|
this.$message.warning("文件下载失败")
|
|
this.$message.warning("文件下载失败")
|
|
return
|
|
return
|
|
@@ -260,7 +277,7 @@
|
|
let link = document.createElement('a')
|
|
let link = document.createElement('a')
|
|
link.style.display = 'none'
|
|
link.style.display = 'none'
|
|
link.href = url
|
|
link.href = url
|
|
- link.setAttribute('download', fileName+'.xlsx')
|
|
|
|
|
|
+ link.setAttribute('download', record.planDate + fileName +'.xlsx')
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
link.click()
|
|
link.click()
|
|
document.body.removeChild(link); //下载完成移除元素
|
|
document.body.removeChild(link); //下载完成移除元素
|
|
@@ -270,12 +287,14 @@
|
|
},
|
|
},
|
|
handleEmal: function (id) {
|
|
handleEmal: function (id) {
|
|
var that = this;
|
|
var that = this;
|
|
|
|
+ that.emailLoading = true;
|
|
let pie = that.pieChart.getDataURL({
|
|
let pie = that.pieChart.getDataURL({
|
|
type: 'png',
|
|
type: 'png',
|
|
pixelRatio: 2, // 设置像素比,提高清晰度
|
|
pixelRatio: 2, // 设置像素比,提高清晰度
|
|
backgroundColor: '#fff' // 设置背景色
|
|
backgroundColor: '#fff' // 设置背景色
|
|
}).replace(/^data:image\/\w+;base64,/, '')
|
|
}).replace(/^data:image\/\w+;base64,/, '')
|
|
postAction(that.url.email, {id: id,pie:pie}).then((res) => {
|
|
postAction(that.url.email, {id: id,pie:pie}).then((res) => {
|
|
|
|
+ that.emailLoading = false;
|
|
this.searchQuery();
|
|
this.searchQuery();
|
|
if (res.success) {
|
|
if (res.success) {
|
|
that.$message.success(res.message);
|
|
that.$message.success(res.message);
|