Browse Source

0412 新看板

master
ruanqi 2 years ago
parent
commit
e7fbd6f11d
  1. 1
      src/api/ftp/oss.js
  2. 2
      src/api/production/inspect.js
  3. 218
      src/views/modules/Abnormal/AbnormalFeedBack.vue
  4. 1
      src/views/modules/production/generateReport.vue

1
src/api/ftp/oss.js

@ -4,3 +4,4 @@ export const ossList = data => createAPI(`sys/oss/ossList`,'post',data)
export const downFtpFileNotFtp = data => createAPI(`ftp/file/downFtpFileNotFtp?id=`+data.id,'post','download') export const downFtpFileNotFtp = data => createAPI(`ftp/file/downFtpFileNotFtp?id=`+data.id,'post','download')
export const ossListForOther= data => createAPI(`sys/oss/ossListForOther`,'post',data)

2
src/api/production/inspect.js

@ -7,3 +7,5 @@ export const inspectPrint = data => createAPI(`inspect/inspectPrint`, 'post', da
export const cancelInspect = data => createAPI(`inspect/cancelInspect`, 'post', data); export const cancelInspect = data => createAPI(`inspect/cancelInspect`, 'post', data);
export const cancelInspectResult = data => createAPI(`inspect/cancelInspectResult`, 'post', data); export const cancelInspectResult = data => createAPI(`inspect/cancelInspectResult`, 'post', data);
export const getSOScheduleRoutingDataForShiyanshi= data => createAPI(`inspect/getSOScheduleRoutingDataForShiyanshi`, 'post', data); export const getSOScheduleRoutingDataForShiyanshi= data => createAPI(`inspect/getSOScheduleRoutingDataForShiyanshi`, 'post', data);
export const downLoadProjectFile = data => createAPI(`abnormal/downLoadProjectFile?id=`+data.id,'post','download')
export const upLoadAbnormalFiles = data => createAPI(`abnormal/upLoadAbnormalFiles`,'post',data);

218
src/views/modules/Abnormal/AbnormalFeedBack.vue

@ -181,6 +181,7 @@
width="300" width="300"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" @click="getFileModel(scope.row)">附件</a>
<a type="text" size="small" @click="getDetailModel(scope.row)">查看</a> <a type="text" size="small" @click="getDetailModel(scope.row)">查看</a>
<a type="text" size="small" @click="doPrint(scope.row)">打印</a> <a type="text" size="small" @click="doPrint(scope.row)">打印</a>
<a type="text" size="small" v-if="scope.row.status!='已完结'" @click="getDetailModel2(scope.row)">紧急处理方式</a> <a type="text" size="small" v-if="scope.row.status!='已完结'" @click="getDetailModel2(scope.row)">紧急处理方式</a>
@ -273,7 +274,6 @@
<span style="font-size: 12px">时间&nbsp&nbsp&nbsp</span> <el-input v-model="abnormalFeedBackData.timeTemporary" :disabled="disableFlag2" style="width: 70px"></el-input> <span style="font-size: 12px">时间&nbsp&nbsp&nbsp</span> <el-input v-model="abnormalFeedBackData.timeTemporary" :disabled="disableFlag2" style="width: 70px"></el-input>
<span style="font-size: 12px">投料量</span> <el-input v-model="abnormalFeedBackData.feedingTemporary" :disabled="disableFlag2" style="width: 70px"></el-input> <span style="font-size: 12px">投料量</span> <el-input v-model="abnormalFeedBackData.feedingTemporary" :disabled="disableFlag2" style="width: 70px"></el-input>
<span style="font-size: 12px">机台&nbsp&nbsp&nbsp</span> <el-input v-model="abnormalFeedBackData.resourceTemporary" :disabled="disableFlag2" style="width: 70px"></el-input> <span style="font-size: 12px">机台&nbsp&nbsp&nbsp</span> <el-input v-model="abnormalFeedBackData.resourceTemporary" :disabled="disableFlag2" style="width: 70px"></el-input>
</el-form> </el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
<span style="font-size: 12px">&nbsp功率&nbsp&nbsp&nbsp</span> <el-input v-model="abnormalFeedBackData.efficiencyTemporary" :disabled="disableFlag2" style="width: 70px"></el-input> <span style="font-size: 12px">&nbsp功率&nbsp&nbsp&nbsp</span> <el-input v-model="abnormalFeedBackData.efficiencyTemporary" :disabled="disableFlag2" style="width: 70px"></el-input>
@ -313,10 +313,66 @@
<el-footer style="height:30px;margin-top: 10px;text-align:center"> <el-footer style="height:30px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveAbnormalDetail()" v-if="disableFlag4">保存</el-button> <el-button type="primary" @click="saveAbnormalDetail()" v-if="disableFlag4">保存</el-button>
<el-button type="primary" @click="modalFlag = false">取消</el-button> <el-button type="primary" @click="modalFlag = false">取消</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog title="附件" :close-on-click-modal="false" v-drag :visible.sync="fileModalFlag" width="650px" >
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
<el-form :inline="true" label-position="top" style="margin-top: 0px">
<el-button type="primary" @click="addUploadFileModal">上传文件</el-button>
</el-form>
</el-form>
<el-table
:data="fileData"
height="240"
border
v-loading="false"
style="width: 100%; ">
<el-table-column
v-for="(item,index) in columnFileContentArray" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-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
fixed="right"
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="scope">
<!-- <a :href="'http://192.168.1.130:80/file/'+scope.row.url" :download="scope.row.fileName">下载</a>-->
<a @click="downloadFile(scope.row)" >下载</a>
<a type="text" size="small" @click="deleteHandle(scope.row.id)">删除</a>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog title="上传附件" :close-on-click-modal="false" v-drag :visible.sync="upLoadModalFlag" width="400px" >
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
<el-upload drag :file-list="fileList"
action="javascript:void(0);" ref="uploadFile"
:on-change="onChange"
multiple :auto-upload="false"
style="text-align: left;">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload>
</el-form>
<el-footer style="height:30px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="upLoadFiles()" >保存</el-button>
<el-button type="primary" @click="upLoadModalFlag = false">取消</el-button>
</el-footer>
</el-dialog>
</div> </div>
</template> </template>
@ -329,21 +385,25 @@
saveAbnormalDetail, saveAbnormalDetail,
openFeedBack, openFeedBack,
closeFeedBack, closeFeedBack,
} from "@/api/abnormal.js" } from "@/api/abnormal.js"
import { import {
getSOScheduleRoutingDataForShiyanshi, getSOScheduleRoutingDataForShiyanshi,
downLoadProjectFile,
upLoadAbnormalFiles,
} from '@/api/production/inspect.js' } from '@/api/production/inspect.js'
import { import {
printABLabel, printABLabel,
} from "@/views/modules/print/print_Abnormal_label.js" } from "@/views/modules/print/print_Abnormal_label.js"
import {ossListForOther} from '@/api/ftp/oss.js'
export default { export default {
name: 'AbnormalFeedBack', name: 'AbnormalFeedBack',
data () { data () {
return { return {
upLoadModalFlag:false,
fileModalFlag:false,
folder: 'abnormal', folder: 'abnormal',
fileList: [], fileList: [],
fileData: [],
searchData:{ searchData:{
userId:this.$store.state.user.name, userId:this.$store.state.user.name,
startDate:'', startDate:'',
@ -354,6 +414,11 @@
operatorDesc:'', operatorDesc:'',
partDesc:'', partDesc:'',
}, },
upLoadData: {
id:0,
site:'',
},
fileContentList: [],
// start // start
exportData: [], exportData: [],
exportDataStandard: { exportDataStandard: {
@ -405,6 +470,11 @@
dataListLoading:false, dataListLoading:false,
// end // end
height:200, height:200,
fileSearchData:{
fileTypeCode:'Abnormal',
orderRef1:'',
orderRef2:''
},
tableData:[], tableData:[],
addData:{ addData:{
site:'', site:'',
@ -429,6 +499,33 @@
abnormalFeedBackData:{ abnormalFeedBackData:{
}, },
columnFileContentArray: [
{
columnProp: 'fileName',
headeralign: 'left',
align: 'left',
columnLabel: '文件名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
}, {
columnProp: 'createDate',
headeralign: 'left',
align: 'left',
columnLabel: '上传时间',
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: false
},
],
} }
}, },
mounted() { mounted() {
@ -460,6 +557,7 @@
this.addData.abnormalRemark='', this.addData.abnormalRemark='',
this.addData.abnormalCode='', this.addData.abnormalCode='',
this.getAllAbnormalItem(); this.getAllAbnormalItem();
this.fileList = [];
this.addModalFlag=true; this.addModalFlag=true;
}, },
seqNoCheck(){ seqNoCheck(){
@ -689,7 +787,115 @@
data.rows[0].abnormalRemark=row.abnormalRemark data.rows[0].abnormalRemark=row.abnormalRemark
printABLabel(data.rows); printABLabel(data.rows);
}) })
}
},
downloadFile(row){
downLoadProjectFile(row)
.then(({data}) => {
//
const blob = new Blob([data], {type: 'application/octet-stream;charset=utf-8'})
//
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
console.log(linkNode)
// if(val == 'Y'){
// this.pdfVisible = true
// this.pdfUrl = linkNode.href
// }else {
document.body.appendChild(linkNode)
linkNode.click() //
URL.revokeObjectURL(linkNode.href) // URL
document.body.removeChild(linkNode)
})
},
getFileModel(row){
this.fileSearchData={
fileTypeCode:'Abnormal',
orderRef1:row.site,
orderRef2:row.id,
}
this.getFileList()
this.fileModalFlag=true;
},
getFileList(){
ossListForOther(this.fileSearchData).then(({data}) => {
if (data && data.code == 0) {
this.fileData = data.data
} else {
this.fileData = []
}
})
},
deleteHandle(id) {
let ids = [id]
this.$confirm(`确定进行[删除]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/oss/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message.success('操作成功')
this.getFileList()
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
})
},
addUploadFileModal(){
this.upLoadData.site=this.fileSearchData.orderRef1
this.upLoadData.id=this.fileSearchData.orderRef2
this.fileList=[]
this.upLoadModalFlag=true;
},
upLoadFiles(){
if(null == this.fileList || 0 === this.fileList.length){
this.$alert('未选择附件上传!', '错误', {
confirmButtonText: '确定'
})
return false;
}
const formData = new FormData();
//
for (let i = 0; i < this.fileList.length; i++) {
formData.append("file",this.fileList[i].raw)
}
formData.append("site", this.upLoadData.site);
formData.append("folder", this.folder);
formData.append("projectId", this.upLoadData.id);
upLoadAbnormalFiles(formData).then(({data}) => {
if (data && data.code === 0) {
this.$refs.uploadFile.clearFiles();
this.fileList = [];
this.upLoadModalFlag=false
this.getFileList()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
}, },
created() { created() {
this.getAllAbnormalItem(); this.getAllAbnormalItem();

1
src/views/modules/production/generateReport.vue

@ -1174,6 +1174,7 @@
this.stopData.abnormalRemark='', this.stopData.abnormalRemark='',
this.stopData.abnormalCode='', this.stopData.abnormalCode='',
this.stopModalFlag=true; this.stopModalFlag=true;
this.fileList = [];
this.$nextTick(() => { this.$refs.stop.focus();}) this.$nextTick(() => { this.$refs.stop.focus();})
}, },
continueScan(){ continueScan(){

Loading…
Cancel
Save