This commit is contained in:
chenjianan
2019-08-06 17:51:47 +08:00
parent 9d05422fc7
commit b054b30bf2
2 changed files with 126 additions and 8 deletions

View File

@@ -85,8 +85,31 @@
size="mini"
@selection-change="handleSelectionChange">
<el-table-column
align="center"
type="selection"
width="55"/>
width="50"/>
<el-table-column align="center" label="照片" width="50">
<template slot-scope="scope">
<el-popover
v-if="scope.row.文件标识 && scope.row.文件标识 !== 'null'"
placement="top-start"
width="200"
trigger="hover">
<el-button type="text" style="float:right" @click="deletePhoto(scope.row)">删除</el-button>
<el-image :src="scope.row.文件标识 && scope.row.文件标识 !== 'null' ? (readFile + scope.row.文件标识 + '.' + scope.row.文件后缀) : readFile + '123.jpg'">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"/>
</div>
</el-image>
<el-image slot="reference" :src="scope.row.文件标识 && scope.row.文件标识 !== 'null' ? (readFile + scope.row.文件标识 + '.' + scope.row.文件后缀) : readFile + '123.jpg'" style="width:23px;">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"/>
</div>
</el-image>
</el-popover>
<span v-else></span>
</template>
</el-table-column>
<el-table-column align="center" label="部门名称" width="100">
<template slot-scope="scope">
{{ scope.row.节点名称 }}
@@ -152,9 +175,10 @@
{{ scope.row.家庭住址 }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="300">
<el-table-column label="操作" fixed="right" align="center" width="220">
<template slot-scope="scope">
<el-button
:disabled="scope.row.文件标识 && scope.row.文件标识 !== 'null'"
size="mini"
type="primary"
icon="el-icon-picture"
@@ -164,11 +188,11 @@
type="primary"
icon="el-icon-edit"
@click="handleEditPeople(scope.row)">编辑</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="deletePeopleTable(scope.row)">删除</el-button>
<!--<el-button-->
<!--size="mini"-->
<!--type="danger"-->
<!--icon="el-icon-delete"-->
<!--@click="deletePeopleTable(scope.row)">删除</el-button>-->
</template>
</el-table-column>
</el-table>
@@ -415,9 +439,14 @@
<script>
import { moveGroups, getTree, tree, getTablePeople, getTablePeopleForName, addDepartmentName, delList, editList, delPeopleList, fetchEducationData, fetchPostData, addPeople, editPeople, quit, searchLeavingList } from '@/api/BasicData/PersonnelManagement'
import { uploadPerson } from '@/utils/request'
import { readFile } from '@/utils/request'
import request from '@/utils/request'
export default {
data() {
return {
limit: 999,
readFile: readFile,
disabledMove: true,
PageCurrentN: 1,
PageSizeN: 10,
@@ -506,6 +535,35 @@ export default {
this.fetchPostData()
},
methods: {
// 删除人员照片
deletePhoto(row) {
this.$confirm('此操作将永久删除该图片, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
request({
url: '',
method: 'post',
data: {
type: '4',
name: `delete from 人员管理_图片 where 人员编号 = ${row.人员编号}`
}
}).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.handleNodeClick()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消删除'
})
})
},
fetchEducationData() {
this.getSelect(fetchEducationData, ['学历名称', '学历编号'], 'EducationDate')
},
@@ -553,6 +611,7 @@ export default {
uploadSuccess(res) { // 上传成功回调
if (res[0].result === '1') {
this.$message.success('增加成功')
this.handleNodeClick()
this.dialogFormVisible = false
this.$refs.upload.clearFiles()
} else {

View File

@@ -11,9 +11,31 @@
height="800"
highlight-current-row
border>
<el-table-column align="center" label="照片" width="50">
<template slot-scope="scope">
<el-popover
v-if="scope.row.文件标识 && scope.row.文件标识 !== 'null'"
placement="top-start"
width="200"
trigger="hover">
<el-button type="text" style="float:right" @click="deletePhoto(scope.row)">删除</el-button>
<el-image :src="scope.row.文件标识 && scope.row.文件标识 !== 'null' ? (readFile + scope.row.文件标识 + '.' + scope.row.文件后缀) : readFile + '123.jpg'">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"/>
</div>
</el-image>
<el-image slot="reference" :src="scope.row.文件标识 && scope.row.文件标识 !== 'null' ? (readFile + scope.row.文件标识 + '.' + scope.row.文件后缀) : readFile + '123.jpg'" style="width:30px;">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"/>
</div>
</el-image>
</el-popover>
<span v-else></span>
</template>
</el-table-column>
<el-table-column align="center" label="工位号">
<template slot-scope="scope">
<el-button type="text">{{ scope.row.工位号 }}</el-button>
<el-button type="text" @click="openNew(scope.row.工位号)">{{ scope.row.工位号 }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="登陆人">
@@ -31,6 +53,7 @@
<el-table-column label="操作" fixed="right" align="center" width="200">
<template slot-scope="scope">
<el-button
:disabled="scope.row.文件标识 && scope.row.文件标识 !== 'null'"
size="mini"
type="primary"
icon="el-icon-picture"
@@ -93,9 +116,13 @@
<script>
import { ANDON_countselect } from '@/api/ManufacturingCenter/AntonMonitoring'
import { wsuri, name1, uploadOP } from '@/utils/request'
import { readFile } from '@/utils/request'
import request from '@/utils/request'
export default {
data() {
return {
readFile: readFile,
limit: 9999,
tableData: [],
timer_ANDON: '',
andonMsg: '',
@@ -117,6 +144,37 @@ export default {
this.initWebpack()
},
methods: {
deletePhoto(row) {
this.$confirm('此操作将永久删除该图片, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
request({
url: '',
method: 'post',
data: {
type: '4',
name: `delete from 设备管理_设备监控_图片 where 工位 = '${row.工位号}'`
}
}).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.ANDON_countselect()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消删除'
})
})
},
openNew(val) {
window.open(`http://192.168.1.231:8008/#/EquipmentConditionAnalysis?opname=${val}`, '_blank')
},
ANDON_countselect() {
ANDON_countselect().then(response => {
this.tableData = response.data
@@ -156,6 +214,7 @@ export default {
if (res[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible = false
this.ANDON_countselect()
this.$refs.upload.clearFiles()
} else {
this.$message.error('增加失败')