|
|
@ -34,9 +34,10 @@ |
|
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column width="50px" type="selection" align="center"/> |
|
|
|
<el-table-column label="操作" width="150px" align="center"> |
|
|
|
<el-table-column label="操作" width="180" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" :disabled="scope.row.state == '已办理'" size="mini" @click="toEdit(scope.row)">办理</el-button> |
|
|
|
<el-button type="primary" :disabled="scope.row.state !== '已办理'" size="mini" @click="handlePrint(scope.row)">下载</el-button> |
|
|
|
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -80,6 +81,27 @@ |
|
|
|
</div> |
|
|
|
<changjiatuikuAdd v-show="viewState == 2" ref="divAdd" @doback="resetState" @reloadlist="getList"/> |
|
|
|
<changjiatuikuInfo v-show="viewState == 3" ref="divInfo" @doback="resetState"/> |
|
|
|
<el-dialog center :visible.sync="dialogVisible" width="40%"> |
|
|
|
<el-form class="formadd"> |
|
|
|
<el-row style="border-top: 1px solid #E0E3EB"> |
|
|
|
<el-col :span="6" class="tleftb"> |
|
|
|
<span>打印机类型</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="18"> |
|
|
|
<el-form-item> |
|
|
|
<el-radio-group v-model="print"> |
|
|
|
<el-radio label="针孔式打印机">针孔式打印机</el-radio> |
|
|
|
<el-radio label="激光打印机">激光打印机</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button size="small" type="primary" @click="handleConfirm">确定</el-button> |
|
|
|
<el-button size="small" @click="dialogVisible = false">取消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@ -91,6 +113,7 @@ import req from '@/api/kucunguanli/changjiachuku' |
|
|
|
import changjiatuikuAdd from './changjiatuikuAdd' |
|
|
|
import changjiatuikuInfo from './changjiatuikuInfo' |
|
|
|
import { getOrgSidByPath } from '@/api/cheliang/dictcommons' |
|
|
|
import {getStorage} from "@/utils/auth"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'changjiatuikuguanli', |
|
|
@ -103,6 +126,9 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
dialogVisible: false, |
|
|
|
printSid: '', |
|
|
|
print: '', |
|
|
|
btndisabled: false, |
|
|
|
btnList: [ |
|
|
|
{ |
|
|
@ -237,6 +263,39 @@ export default { |
|
|
|
this.viewState = 3 |
|
|
|
this.$refs['divInfo'].showInfo(row) |
|
|
|
}, |
|
|
|
handlePrint(row) { |
|
|
|
this.printSid = row.sid |
|
|
|
this.print = '' |
|
|
|
this.dialogVisible = true |
|
|
|
}, |
|
|
|
handleConfirm() { |
|
|
|
req.createPdf({ cgtkdSid: this.printSid, printerType: this.print }).then((resp) => { |
|
|
|
if (resp.success && resp.data !== '') { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
|
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + resp.data + '&outFileName=' + '退料单', true) |
|
|
|
xhr.setRequestHeader('token', getStorage()) |
|
|
|
xhr.responseType = 'blob' |
|
|
|
xhr.onload = function(e) { |
|
|
|
// 如果请求执行成功 |
|
|
|
var blob = this.response |
|
|
|
var filename = '退料单.pdf' |
|
|
|
var a = document.createElement('a') |
|
|
|
// blob.type="application/octet-stream"; |
|
|
|
// 创键临时url对象 |
|
|
|
var url = URL.createObjectURL(blob) |
|
|
|
a.href = url |
|
|
|
a.download = filename |
|
|
|
a.click() |
|
|
|
// 释放之前创建的URL对象 |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
} |
|
|
|
// 发送请求 |
|
|
|
xhr.send() |
|
|
|
this.dialogVisible = false |
|
|
|
this.printSid = '' |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.viewState = 1 |
|
|
|
}, |
|
|
|