Browse Source

ftp 下载 sxm 2021-11-2

master
[li_she] 4 years ago
parent
commit
2a3b386401
  1. 3
      src/views/common/login.vue
  2. 44
      src/views/modules/purchaseorder/purchaseRequisition.vue

3
src/views/common/login.vue

@ -173,4 +173,7 @@
border-radius: 4px; border-radius: 4px;
} }
} }
/deep/ .el-form-item{
margin-bottom:-5px;
}
</style> </style>

44
src/views/modules/purchaseorder/purchaseRequisition.vue

@ -105,7 +105,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<a v-if="scope.row.authorizeFlag == 'N'" @click="initAddModel(scope.row)">{{ buttons.edit }}</a> <a v-if="scope.row.authorizeFlag == 'N'" @click="initAddModel(scope.row)">{{ buttons.edit }}</a>
<a v-if="scope.row.authorizeFlag == 'N'" @click="updateAuthorizeFlag(scope.row)">{{ buttons.close }}</a> <a v-if="scope.row.authorizeFlag == 'N'" @click="updateAuthorizeFlag(scope.row)">{{ buttons.close }}</a>
<a v-if="scope.row.authorizeFlag == 'Y' && scope.row.approvedFlag != 'Y' && scope.row.approveresult == '审批未通过'"@click="initReapply(scope.row)">{{buttons.reapply}}</a>
<a
v-if="scope.row.authorizeFlag == 'Y' && scope.row.approvedFlag != 'Y' && scope.row.approveresult == '审批未通过'"
@click="initReapply(scope.row)">{{ buttons.reapply }}</a>
<a @click="initReviewDetails(scope.row.requisitionno)">{{ buttons.reviewDetails }}</a> <a @click="initReviewDetails(scope.row.requisitionno)">{{ buttons.reviewDetails }}</a>
</template> </template>
</el-table-column> </el-table-column>
@ -198,24 +200,27 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="inputSearch6"> <el-form-item :label="inputSearch6">
<el-input style="text-align: left;width: 143px" onkeyup="this.value = this.value.toUpperCase()" v-model="currentPRDetailData.partno"></el-input>
<el-input style="text-align: left;width: 143px" onkeyup="this.value = this.value.toUpperCase()"
v-model="currentPRDetailData.partno"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="inputSearch11"> <el-form-item :label="inputSearch11">
<el-input style="text-align: left;width: 143px" v-model="currentPRDetailData.partdesc"></el-input> <el-input style="text-align: left;width: 143px" v-model="currentPRDetailData.partdesc"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="inputSearch7"> <el-form-item :label="inputSearch7">
<el-input style="text-align: left;width: 143px" @change="getNumber()" oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
<el-input style="text-align: left;width: 143px" @change="getNumber()"
oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
v-model="currentPRDetailData.qty"></el-input> v-model="currentPRDetailData.qty"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="inputSearch8"> <el-form-item :label="inputSearch8">
<el-input style="text-align: left;width: 143px" v-model="currentPRDetailData.price" @change="getNumber()" oninput="value=value.replace(/^\.+|[^\d.]/g,'')"></el-input>
<el-input style="text-align: left;width: 143px" v-model="currentPRDetailData.price" @change="getNumber()"
oninput="value=value.replace(/^\.+|[^\d.]/g,'')"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="inputSearch9"> <el-form-item :label="inputSearch9">
<el-input style="text-align: left;width: 143px" <el-input style="text-align: left;width: 143px"
v-model="currentPRDetailData.totalPrice" v-model="currentPRDetailData.totalPrice"
:disabled="true"></el-input> :disabled="true"></el-input>
</el-form-item> </el-form-item>
<!--<el-form-item style="margin-top: 10px">
<el-form-item style="margin-top: 10px">
<upload v-on:childByValue="childByValue"></upload> <upload v-on:childByValue="childByValue"></upload>
</el-form-item> </el-form-item>
<el-table <el-table
@ -251,7 +256,7 @@
<a @click="fileDownload(scope.row)">{{ buttons.fileDownload }}</a> <a @click="fileDownload(scope.row)">{{ buttons.fileDownload }}</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table>-->
</el-table>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="addPRDetailFlag = false">取消</el-button> <el-button @click="addPRDetailFlag = false">取消</el-button>
@ -321,6 +326,7 @@
downFtpFile, downFtpFile,
} from '@/api/purchaseorder/purchaseRequisition.js' } from '@/api/purchaseorder/purchaseRequisition.js'
import upload from "../common/upload"; import upload from "../common/upload";
export default { export default {
components: {upload}, components: {upload},
data() { data() {
@ -993,12 +999,30 @@
}, },
methods: { methods: {
//
fileDownload(row) { fileDownload(row) {
let downLoadData = {
id : row.id
this.$http({
url: this.$http.adornUrl('ftp/file/downFtpFile'),
method: 'post',
data: JSON.stringify(row),
responseType: 'blob',
headers: {
'Content-Type': 'application/json'
} }
downFtpFile(downLoadData).then(({data}) =>{
}).then(({data}) => {
//
const blob = new Blob([data], {type: "application/octet-stream"})
//
const fileName = row.fileName
// a
const linkNode = document.createElement('a')
linkNode.download = fileName // adownload
linkNode.style.display = 'none'
linkNode.href = URL.createObjectURL(blob) // Blob URL
document.body.appendChild(linkNode)
linkNode.click() //
URL.revokeObjectURL(linkNode.href) // URL
document.body.removeChild(linkNode)
}) })
}, },
childByValue(childValue) { childByValue(childValue) {

Loading…
Cancel
Save