This commit is contained in:
liushuai
2019-07-24 09:38:04 +08:00
parent 5b29bf5f1a
commit 78963ec5ae
8 changed files with 156 additions and 8 deletions

View File

@@ -28,6 +28,15 @@
<div v-else ><div style="width: 12px;height: 12px;border-radius: 50%;background-color: red;display: inline-block;margin:0px 5px 0 0"/>{{ scope.row.呼叫备注 }}</div>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-picture"
@click="handlePicture(scope.row)">上传图片</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
@@ -59,12 +68,31 @@
</el-table-column>
</el-table>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible" title="上传图片" center style="height: 800px" width="30%">
<el-upload
id="invoiceScan"
ref="upload"
:multiple="true"
:auto-upload="false"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
:on-exceed="warningExceed"
:limit="limit"
:action="upload+'?num='+ OPId"
list-type="picture-card">
<i class="el-icon-plus"/>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible=false">取消</el-button>
<el-button type="primary" style="width: 70px" @click="submitPerson()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { ANDON_countselect } from '@/api/ManufacturingCenter/AntonMonitoring'
import { wsuri, name1 } from '@/utils/request'
import { wsuri, name1, uploadOP } from '@/utils/request'
export default {
data() {
return {
@@ -72,6 +100,9 @@ export default {
timer_ANDON: '',
andonMsg: '',
Name: '',
upload: uploadOP,
dialogFormVisible: false,
OPId: '',
massage: [],
dialogVisible: false,
tableDataMassage: [],
@@ -121,6 +152,32 @@ export default {
websocketerror() {
console.log('WebSocket连接失败')
},
uploadSuccess(res) { // 上传成功回调
if (res[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible = false
this.$refs.upload.clearFiles()
} else {
this.$message.error('增加失败')
}
},
beforeUpload(file) { // 上传前检测
const isJPG = /^image\/.*/.test(file.type)
if (!isJPG) {
this.$message.error('只能上传图片。。')
}
return isJPG
},
warningExceed() {
this.$message.error('仅可上传五张照片')
},
handlePicture(row) {
this.dialogFormVisible = true
this.OPId = row.工位号
},
submitPerson() {
this.$refs.upload.submit()
},
search() {
this.tableDataMassage = []
ANDON_countselect().then(response => {