Browse Source

刀模申请, 工具接收 上传下载新增

master
zuowenwen 4 years ago
parent
commit
9170390fd1
  1. 3
      src/api/knifemold/receive.js
  2. 3
      src/api/purchaseorder/procurementReview.js
  3. 2
      src/api/purchaseorder/purchaseRequisition.js
  4. 51
      src/views/modules/common/upload.vue
  5. 151
      src/views/modules/knifemold/receive.vue
  6. 147
      src/views/modules/purchaseorder/procurementReview.vue
  7. 29
      src/views/modules/purchaseorder/purchaseRequisition.vue

3
src/api/knifemold/receive.js

@ -18,5 +18,8 @@ export const saveToolDetail = data => createAPI(`toolMan/saveToolDetail`,'POST
// 获取库位信息 // 获取库位信息
export const exportList = data => createAPI(`toolMan/getExportList`,'POST',data) export const exportList = data => createAPI(`toolMan/getExportList`,'POST',data)
//获取审批记录信息
export const getFileList = data => createAPI(`sys/oss/getSysOssEntityList`,'POST' ,data)

3
src/api/purchaseorder/procurementReview.js

@ -14,3 +14,6 @@ export const getExportList = data => createAPI(`PRHeader/getExportList`,'POST',d
//获取审核步骤信息 //获取审核步骤信息
export const getReviewSteps = data => createAPI(`PRHeader/getReviewSteps`,'POST',data) export const getReviewSteps = data => createAPI(`PRHeader/getReviewSteps`,'POST',data)
//获取审批记录信息
export const getFileList = data => createAPI(`sys/oss/getSysOssEntityList`,'POST' ,data)

2
src/api/purchaseorder/purchaseRequisition.js

@ -24,6 +24,8 @@ export const updatePRHeaderAuthorizeFlag = data => createAPI(`PRHeader/updatePRH
//获取审批记录信息 //获取审批记录信息
export const downFtpFile = data => createAPI(`ftp/file/downFtpFile?ossEntity=`+data.id,'GET') export const downFtpFile = data => createAPI(`ftp/file/downFtpFile?ossEntity=`+data.id,'GET')
//获取审批记录信息
export const getFileList = data => createAPI(`sys/oss/getSysOssEntityList`,'POST' ,data)

51
src/views/modules/common/upload.vue

@ -1,38 +1,38 @@
<template> <template>
<div>
<!-- 弹窗, 上传文件 -->
<el-upload
:action="url"
:before-upload="beforeUploadHandle"
:on-success="successHandle"
multiple
:show-file-list="false"
style="text-align: center;">
<el-button size="small" type="primary">点击上传</el-button>
<div>
<!-- 弹窗, 上传文件 -->
<el-upload
:action="url"
:before-upload="beforeUploadHandle"
:on-success="successHandle"
multiple
:show-file-list="false"
style="text-align: center;">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</el-upload>
</div>
</template> </template>
<script> <script>
export default { export default {
data () {
data() {
return { return {
url: '', url: '',
num: 0, num: 0,
successNum: 0, successNum: 0,
fileList: [],
fileList: {},
folder: '系统文件' folder: '系统文件'
} }
}, },
methods: { methods: {
init (id) {
this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token')}&folder=`+this.folder)
init(id) {
this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token')}&folder=` + this.folder)
console.log(this.url) console.log(this.url)
this.visible = true this.visible = true
}, },
// //
beforeUploadHandle (file) {
beforeUploadHandle(file) {
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') { // if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
// this.$message.error('jpgpnggif') // this.$message.error('jpgpnggif')
// return false // return false
@ -40,18 +40,13 @@
this.num++ this.num++
}, },
// //
successHandle (response, file, fileList) {
this.fileList = fileList.map(item => {
return item.response.ossEntity
})
this.successNum++
if (response && response.code === 0) {
this.childClick()
} else {
this.$message.error(response.msg)
}
successHandle(response, file, fileList) {
this.fileList = response.ossEntity
this.childClick()
return response.ossEntity
}, },
childClick () {
childClick() {
// childByValueon // childByValueon
this.$emit('childByValue', this.fileList) this.$emit('childByValue', this.fileList)
} }

151
src/views/modules/knifemold/receive.vue

@ -64,10 +64,11 @@
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="50"
width="100"
:label="buttons.operating"> :label="buttons.operating">
<template slot-scope="scope"> <template slot-scope="scope">
<a @click="initBannersFlag(scope.row)">{{buttons.receive}}</a> <a @click="initBannersFlag(scope.row)">{{buttons.receive}}</a>
<a @click="initFileModel(scope.row)">{{buttons.appendixInfo}}</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -75,7 +76,7 @@
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" @current-change="currentChangeHandle"
:current-page="pageIndex" :current-page="pageIndex"
:page-sizes="[10, 50, 200, 500]"
:page-sizes="[100, 200, 500]"
:page-size="pageSize" :page-size="pageSize"
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
@ -153,6 +154,44 @@
</el-form> </el-form>
</el-dialog> </el-dialog>
<el-dialog title="附件信息" :visible.sync="setUp.fileFlag" width="672px" :close-on-click-modal="false"
:close-on-press-escape="false" v-drag>
<el-form :inline="true" label-position="top">
<el-table
height="170"
:data="fileList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList2" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="50"
:label="buttons.operating">
<template slot-scope="scope">
<a @click="fileDownload(scope.row)">{{ buttons.fileDownload }}</a>
</template>
</el-table-column>
</el-table>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
@ -181,6 +220,7 @@
saveToolDetail, saveToolDetail,
updateIfsTool, updateIfsTool,
exportList, exportList,
getFileList,
} from "@/api/knifemold/receive.js" } from "@/api/knifemold/receive.js"
export default { export default {
@ -189,6 +229,11 @@
}, },
data() { data() {
return { return {
fileList : [],
//
setUp: {
fileFlag : false,
},
height: 0, height: 0,
// //
inputSearch1 : "工具编码", inputSearch1 : "工具编码",
@ -572,6 +617,59 @@
// fixed: false, // fixed: false,
// } // }
], ],
//
columnList2: [
{
userId: this.$store.state.user.name,
functionId: 2102,
tableId: "fileDetail2102",
tableName: "fileDetailTable",
columnProp: "fileName",
headerAlign: "center",
align: "center",
columnLabel: "文件名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 2102,
tableId: "fileDetail2102",
tableName: "fileDetailTable",
columnProp: "createDate",
headerAlign: "center",
align: "center",
columnLabel: "创建时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 135,
},
{
userId: this.$store.state.user.name,
functionId: 2102,
tableId: "fileDetail2102",
tableName: "fileDetailTable",
columnProp: "createdBy",
headerAlign: "center",
align: "center",
columnLabel: "创建人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 70,
},
],
// //
dataList: [], dataList: [],
currSelectList : [], currSelectList : [],
@ -595,6 +693,8 @@
defaultTable: '设置默认配置', defaultTable: '设置默认配置',
generate : "生成", generate : "生成",
print : '打印', print : '打印',
appendixInfo: '附件信息',
fileDownload: '下载',
}, },
// start // start
exportData: [], exportData: [],
@ -688,7 +788,7 @@
}, },
// //
pageIndex: 1, pageIndex: 1,
pageSize: 10,
pageSize: 100,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
@ -719,6 +819,51 @@
} }
}, },
methods: { methods: {
//
fileDownload(row) {
this.$http({
url: this.$http.adornUrl('ftp/file/downFtpFile'),
method: 'post',
data: JSON.stringify(row),
responseType: 'blob',
headers: {
'Content-Type': 'application/json'
}
}).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)
})
},
//
initFileModel(row){
this.getFileList(row)
this.setUp.fileFlag = true
},
//
getFileList(row){
let jsonData = {
site : row.site,
type : 'PRFile',
associatedField1 : row.transactionId
}
this.fileList = []
getFileList(jsonData).then(({data}) =>{
if(data.code == 0){
this.fileList = data.row
}
})
},
getCurrSelectList(row){ getCurrSelectList(row){
this.currSelectList = row this.currSelectList = row
}, },

147
src/views/modules/purchaseorder/procurementReview.vue

@ -98,6 +98,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<a v-if="scope.row.strCanAuthFlag == 'Y'" @click="initReview(scope.row)">{{buttons.audit}}</a> <a v-if="scope.row.strCanAuthFlag == 'Y'" @click="initReview(scope.row)">{{buttons.audit}}</a>
<span v-else>{{buttons.audit}}</span> <span v-else>{{buttons.audit}}</span>
<a @click="initFileModel(scope.row)">{{buttons.appendixInfo}}</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -144,6 +145,45 @@
<el-button type="primary" @click="naxtStep('x')">下一步</el-button>--> <el-button type="primary" @click="naxtStep('x')">下一步</el-button>-->
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="附件信息" :visible.sync="setUp.fileFlag" width="672px" :close-on-click-modal="false"
:close-on-press-escape="false" v-drag>
<el-form :inline="true" label-position="top">
<el-table
height="170"
:data="fileList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList2" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="50"
:label="buttons.operating">
<template slot-scope="scope">
<a @click="fileDownload(scope.row)">{{ buttons.fileDownload }}</a>
</template>
</el-table-column>
</el-table>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
@ -175,6 +215,7 @@
getTblBaseDataList, getTblBaseDataList,
getExportList, getExportList,
getReviewSteps, getReviewSteps,
getFileList,
} from '@/api/purchaseorder/procurementReview.js' } from '@/api/purchaseorder/procurementReview.js'
export default { export default {
@ -183,6 +224,7 @@
}, },
data() { data() {
return { return {
fileList: [],
active: 0, active: 0,
currentReviewStepData :{}, currentReviewStepData :{},
reviewStepList: [], reviewStepList: [],
@ -219,6 +261,7 @@
inputSearch5: '审核意见', inputSearch5: '审核意见',
inputSearch6: '审核人', inputSearch6: '审核人',
inputSearch7: '审核时间', inputSearch7: '审核时间',
inputSearch8: '附件信息',
// table // table
height: 450, height: 450,
// //
@ -233,6 +276,7 @@
setUp: { setUp: {
reviewFlag: false, reviewFlag: false,
saveButton: false, saveButton: false,
fileFlag : false,
}, },
mainQueryData: { mainQueryData: {
requisitionno: '', requisitionno: '',
@ -507,6 +551,59 @@
// fixed: false, // fixed: false,
// } // }
], ],
//
columnList2: [
{
userId: this.$store.state.user.name,
functionId: 2102,
tableId: "fileDetail2102",
tableName: "fileDetailTable",
columnProp: "fileName",
headerAlign: "center",
align: "center",
columnLabel: "文件名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 2102,
tableId: "fileDetail2102",
tableName: "fileDetailTable",
columnProp: "createDate",
headerAlign: "center",
align: "center",
columnLabel: "创建时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 135,
},
{
userId: this.$store.state.user.name,
functionId: 2102,
tableId: "fileDetail2102",
tableName: "fileDetailTable",
columnProp: "createdBy",
headerAlign: "center",
align: "center",
columnLabel: "创建人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 70,
},
],
// //
dataList: [], dataList: [],
queryButton: { queryButton: {
@ -522,7 +619,9 @@
defaultTable: '设置默认配置', defaultTable: '设置默认配置',
operating: '操作', operating: '操作',
audit: '审批', audit: '审批',
reviewDetails: '审批详情'
reviewDetails: '审批详情',
appendixInfo: '附件信息',
fileDownload: '下载',
}, },
// start // start
exportData: [], exportData: [],
@ -625,7 +724,7 @@
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.height = window.innerHeight - 220;
this.height = window.innerHeight - 240;
}) })
}, },
activated() { activated() {
@ -636,6 +735,36 @@
// zufoeav // zufoeav
}, },
methods: { methods: {
//
fileDownload(row) {
this.$http({
url: this.$http.adornUrl('ftp/file/downFtpFile'),
method: 'post',
data: JSON.stringify(row),
responseType: 'blob',
headers: {
'Content-Type': 'application/json'
}
}).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)
})
},
initFileModel(row){
this.getFileList(row)
this.setUp.fileFlag = true
},
/*naxtStep(val){ /*naxtStep(val){
if (val == 's' && this.active != 0){ if (val == 's' && this.active != 0){
this.active -= 1 this.active -= 1
@ -645,6 +774,20 @@
} }
},*/ },*/
//
getFileList(row){
let jsonData = {
site : row.site,
type : 'PRFile',
associatedField1 : row.requisitionno
}
this.fileList = []
getFileList(jsonData).then(({data}) =>{
if(data.code == 0){
this.fileList = data.row
}
})
},
getReviewStepList(orderRef1) { getReviewStepList(orderRef1) {
this.reviewStepList = [] this.reviewStepList = []
let queryData = { let queryData = {

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

@ -219,11 +219,11 @@
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: 30px">
<upload v-on:childByValue="childByValue"></upload> <upload v-on:childByValue="childByValue"></upload>
</el-form-item> </el-form-item>
<el-table <el-table
height="120"
height="170"
:data="fileList" :data="fileList"
border border
v-loading="dataListLoading" v-loading="dataListLoading"
@ -246,7 +246,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="50" width="50"
@ -323,6 +322,7 @@ import {
authorizationHistList, authorizationHistList,
updatePRHeaderAuthorizeFlag, updatePRHeaderAuthorizeFlag,
downFtpFile, downFtpFile,
getFileList,
} from '@/api/purchaseorder/purchaseRequisition.js' } from '@/api/purchaseorder/purchaseRequisition.js'
import upload from "../common/upload"; import upload from "../common/upload";
@ -330,6 +330,7 @@ export default {
components: {upload}, components: {upload},
data() { data() {
return { return {
insertFileList : [],
fileList: [], fileList: [],
// table // table
height: 0, height: 0,
@ -368,6 +369,7 @@ export default {
additionalCose: 0, additionalCose: 0,
orderref1: '', orderref1: '',
orderref2: '', orderref2: '',
sysOssEntityList : [],
}, },
mainQueryData: { mainQueryData: {
requisitionno: '', requisitionno: '',
@ -998,6 +1000,20 @@ export default {
}, },
methods: { methods: {
//
getFileList(row){
let jsonData = {
site : row.site,
type : 'PRFile',
associatedField1 : row.requisitionno
}
this.fileList = []
getFileList(jsonData).then(({data}) =>{
if(data.code == 0){
this.fileList = data.row
}
})
},
// //
fileDownload(row) { fileDownload(row) {
this.$http({ this.$http({
@ -1026,7 +1042,8 @@ export default {
}, },
childByValue(childValue) { childByValue(childValue) {
// childValue // childValue
this.fileList = childValue
this.fileList.push( childValue )
this.insertFileList.push( childValue )
}, },
updateAuthorizeFlag(row) { updateAuthorizeFlag(row) {
let saveData = { let saveData = {
@ -1123,6 +1140,8 @@ export default {
this.currentPRDetailData.suppliername = filter[0].suppliername this.currentPRDetailData.suppliername = filter[0].suppliername
this.currentPRDetailData.currency = filter[0].currency this.currentPRDetailData.currency = filter[0].currency
this.currentPRDetailData.taxcode = filter[0].taxcode this.currentPRDetailData.taxcode = filter[0].taxcode
this.currentPRDetailData.fileType = 'PRFile'
this.currentPRDetailData.sysOssEntityList = this.insertFileList
savePRDetail(this.currentPRDetailData).then(({data}) => { savePRDetail(this.currentPRDetailData).then(({data}) => {
this.bannersBut = false this.bannersBut = false
if (data.code == 0) { if (data.code == 0) {
@ -1164,6 +1183,7 @@ export default {
}, },
initAddModel(row, val) { initAddModel(row, val) {
this.fileList = [] this.fileList = []
this.insertFileList = []
if (row == null) { if (row == null) {
this.currentPRDetailData.requisitionno = '' this.currentPRDetailData.requisitionno = ''
this.currentPRDetailData.itemno = '' this.currentPRDetailData.itemno = ''
@ -1188,6 +1208,7 @@ export default {
this.currentPRDetailData.status = '' this.currentPRDetailData.status = ''
this.currentPRDetailData.taxCode = row.taxCode this.currentPRDetailData.taxCode = row.taxCode
this.currentPRDetailData.partDesc = row.partdesc this.currentPRDetailData.partDesc = row.partdesc
this.getFileList(row)
} }
if (val != 'Y') { if (val != 'Y') {
this.currentPRDetailData.orderref1 = null this.currentPRDetailData.orderref1 = null

Loading…
Cancel
Save