1.将套料图PDF文件上传功能合并到导入基础数据功能

2.增加班组组织管理页面,班组织增删改查功能,及对应班组织人员查询
master
xiaoning 1 year ago
parent a90f64d15a
commit f6f9833bb7

@ -0,0 +1,41 @@
import request from "@/utils/request";
// 获取列表
export function getList(data) {
return request({
url: "/dmBzzz/getList",
method: "post",
data,
});
}
// 修改
export function update(data) {
return request({
url: "/dmBzzz/update",
method: "post",
data,
});
}
export function del(data) {
return request({
url: "/dmBzzz/del",
method: "post",
data,
});
}
export function save(data) {
return request({
url: "/dmBzzz/save",
method: "post",
data,
});
}
export function getBzryList(data) {
return request({
url: "/dmBzry/getList",
method: "post",
data,
});
}

@ -67,19 +67,19 @@
<el-row> <el-row>
<el-col :span="5" :offset="19" > <el-col :span="5" :offset="19" >
<el-form-item style="float: left;width: 45%;padding-left: 10%"> <el-form-item style="float: left;width: 45%;padding-left: 10%">
<el-upload <!-- <el-upload-->
ref="upload2" <!-- ref="upload2"-->
action="" <!-- action=""-->
:file-list="fileList2" <!-- :file-list="fileList2"-->
:auto-upload="false" <!-- :auto-upload="false"-->
:multiple="true" <!-- :multiple="true"-->
:on-change="handleChange2" <!-- :on-change="handleChange2"-->
:on-success="sucessChange2" <!-- :on-success="sucessChange2"-->
:directory="true" <!-- :directory="true"-->
:show-file-list="false" <!-- :show-file-list="false"-->
> <!-- >-->
<el-button type="primary" @click="handleAddFolder2"></el-button> <!-- <el-button type="primary" @click="handleAddFolder2"></el-button>-->
</el-upload> <!-- </el-upload>-->
</el-form-item> </el-form-item>
<el-form-item style="float: right;width:45%;padding-left: 10%" > <el-form-item style="float: right;width:45%;padding-left: 10%" >
<!-- <el-button--> <!-- <el-button-->
@ -1003,33 +1003,6 @@ export default {
}, },
methods: { methods: {
uploadExcel() {
// if (this.queryParam.cbbm === '') {
// this.$message.error('')
// return false;
// } else {
//
// }
// this.uploadData.czbh = this.queryParam.czbh
this.uploadData.isupload = this.isupload
},
czbhChange(){
// if (this.queryParam.dcch === '') {
// this.$message.error('')
// return false;
// }
// if (this.queryParam.dcpl === '') {
// this.$message.error('')
// return false;
// }
// if (this.queryParam.cbbm === '') {
// this.filedis=true
// }else{
// this.filedis=false
// }
},
handleAddFolder2 () { handleAddFolder2 () {
this.tableupload2=[], this.tableupload2=[],
this.$nextTick(() => { this.$nextTick(() => {
@ -1062,9 +1035,6 @@ export default {
}) })
}, },
uploadpre(name){
},
handleChange2(file, fileList) { handleChange2(file, fileList) {
this.fileList2 = fileList this.fileList2 = fileList
let folderName = file.name; let folderName = file.name;
@ -1081,9 +1051,8 @@ export default {
}, },
handleChange(file, fileList) { handleChange(file, fileList) {
this.fileList = fileList this.fileList = fileList
console.log(file)
console.log(fileList)
const bcph="" const bcph=""
if (file.name.includes(".BC")||file.name.includes(".LST")||file.name.includes(".XC")){
if (file.name.includes("板材领取表")) { if (file.name.includes("板材领取表")) {
this.czbhu= file.name.split("_")[0] this.czbhu= file.name.split("_")[0]
var underscoreIndex = file.name.indexOf("_"); var underscoreIndex = file.name.indexOf("_");
@ -1130,6 +1099,7 @@ export default {
let a={czbh:this.czbhu,ph:this.phu,type:"",stype:"套料图",name:file.name,sort:5} let a={czbh:this.czbhu,ph:this.phu,type:"",stype:"套料图",name:file.name,sort:5}
this.tableupload.push(a); this.tableupload.push(a);
} }
// console.log(file.name)
if((file.name.match(/-/g)).length ===3){ if((file.name.match(/-/g)).length ===3){
this.ljList.push(file.name); this.ljList.push(file.name);
var parts = file.name.split('-') var parts = file.name.split('-')
@ -1149,19 +1119,29 @@ export default {
this.queryParam.dcch=this.czbhu this.queryParam.dcch=this.czbhu
this.queryParam.dcpl=this.phu this.queryParam.dcpl=this.phu
// //
}
//pdf 20240530
if ( file.name.includes("数控套料图")&&file.name.includes('.pdf') ) {
this.tltList2.push(file)
let a={czbh:this.czbhu,ph:this.phu,type:"",stype:"数控套料图",name:file.name,sort:6}
this.tableupload.push(a);
this.tableupload.sort((a,b)=>{
return( a.sort - b.sort)
})
}
this.dialogVisible=true; this.dialogVisible=true;
}, },
// false Promise rejectfunction(file, fileList) // false Promise rejectfunction(file, fileList)
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.fileList = fileList this.fileList = fileList
}, },
sucessChange2(file,fileList){ sucessChange2(file,fileList){
alert(1) alert(1)
}, },
submitUpload2() { submitUpload2() {
// //
if (this.fileList2.length === 0) { if (this.fileList2.length === 0) {
return this.$message.warning('请选取文件后再上传') return this.$message.warning('请选取文件后再上传')
@ -1188,6 +1168,7 @@ export default {
}, },
// //
submitUpload() { submitUpload() {
console.log(this.fileList2.length)
// //
if (this.fileList.length === 0) { if (this.fileList.length === 0) {
return this.$message.warning('请选取文件后再上传') return this.$message.warning('请选取文件后再上传')
@ -1196,15 +1177,15 @@ export default {
if(this.bclqList.length ==0){ if(this.bclqList.length ==0){
return this.$message.warning('缺少板材领取数据') return this.$message.warning('缺少板材领取数据')
} }
if(this.xclqList.length ==0){ // if(this.xclqList.length ==0){
return this.$message.warning('缺少型材领取数据') // return this.$message.warning('')
} // }
if(this.bctjList.length ==0){ if(this.bctjList.length ==0){
return this.$message.warning('缺少板材统计数据') return this.$message.warning('缺少板材统计数据')
} }
if(this.xctjList.length==0){ // if(this.xctjList.length==0){
return this.$message.warning('缺少型材统计数据') // return this.$message.warning('')
} // }
// FormData: // FormData:
const formData = new FormData() const formData = new FormData()
@ -1212,6 +1193,9 @@ export default {
this.fileList.forEach((file) => { this.fileList.forEach((file) => {
formData.append('file', file.raw) formData.append('file', file.raw)
}) })
this.tltList2.forEach((file) => {
formData.append('tltList', file.raw)
})
// //
formData.append('czbh', this.queryParam.dcch) formData.append('czbh', this.queryParam.dcch)
formData.append('pl', this.queryParam.dcpl) formData.append('pl', this.queryParam.dcpl)

@ -0,0 +1,402 @@
<template>
<el-container style="height: 100%;position: absolute;width: 100%;">
<el-col :span="16" style="height:100%;">
<div style="color:#909399;font-size: 12px;height: 9%">
所属公司
<el-select v-model="query.companyName" clearable placeholder="所属公司" style="width: 100px">
<el-option
v-for="item in dm_depart"
:key="item.depart_code"
:label="item.depart_name"
:value="item.depart_code"
/>
</el-select>
班组编码
<el-input v-model="query.resourcesCode" placeholder="班组编码" style="width: 100px" clearable />
班组名称
<el-input v-model="query.resourcesName" placeholder="班组名称" style="width: 100px" clearable />
班组分类
<el-select v-model="query.classification" clearable placeholder="班组分类" style="width: 100px">
<el-option
v-for="item in dm_depart"
:key="item.depart_code"
:label="item.depart_name"
:value="item.depart_code"
/>
</el-select>
班组状态
<el-select v-model="query.flagStatus" clearable placeholder="班组状态" style="width: 100px">
<el-option
v-for="item in dm_depart"
:key="item.depart_code"
:label="item.depart_name"
:value="item.depart_code"
/>
</el-select>
<div style="float: right;">
<el-button style="margin: 1px;" type="primary" icon="el-icon-search">查询</el-button>
<el-button style="margin: 1px" type="success" @click="handleAddYhxx"></el-button>
<el-button style="margin: 1px" type="warning" @click="handleUpdateYhxx"></el-button>
<el-button style="margin: 1px" type="danger" @click="handleDeleteYhxx"></el-button>
</div>
</div>
<el-table
ref="bzxxTable"
:show-overflow-tooltip="true"
:data="c_yhxxTableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
height="calc(100% - 60px - 35px)"
width="100%"
:border="true"
highlight-current-row
@current-change="handleYhxxCurrentChange"
@header-click="showFilter"
>
<el-table-column label="" property="checked" min-width="40">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.checked" />
</template>
</el-table-column>
<el-table-column label="序号" type="index" />
<el-table-column label="班组编码" property="resourcesCode" />
<el-table-column label="班组名称" property="resourcesName" />
<el-table-column label="是否资源" property="resource" />
<el-table-column label="所属工厂" property="factoryName" />
<el-table-column label="所属车间" property="workshopName" />
<el-table-column label="所属产线" property="productionLineName" />
<el-table-column label="组织类型" property="resourcesType" />
<el-table-column label="外部对照码" property="comparisonCode" />
<el-table-column label="班组分类" property="classification" />
<el-table-column label="状态" property="flagStatus" />
<!-- <el-table-column label="操作" fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button @click="handleDeleteYhxx2" type="text" size="small" style="text-align: center;color: red">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-pagination
:current-page="currentPage"
:page-sizes="[20, 50, 100, 10000]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="c_yhxxTableData.length"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<el-dialog class="YhxxDialog" :title="dialogTitle" :visible.sync="dialogVisible" width="450px" center="">
<el-row>
<el-row>
<span style="width: 110px;display:inline-block;">班组编码</span>
<el-input v-model="updateData.resourcesCode" placeholder="" style="width: 250px;" :disabled="inputDisabled"/>
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">班组名称</span>
<el-input v-model="updateData.resourcesName" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">是否资源</span>
<el-input v-model="updateData.resource" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">所属工厂</span>
<el-input v-model="updateData.factoryName" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">所属车间</span>
<el-input v-model="updateData.workshopName" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">所属产线</span>
<el-input v-model="updateData.productionLineName" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">组织类型</span>
<el-input v-model="updateData.resourcesType" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">外部对照码</span>
<el-input v-model="updateData.comparisonCode" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">班组分类</span>
<el-input v-model="updateData.classification" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<span style="width: 110px;display:inline-block;">状态</span>
<el-input v-model="updateData.flagStatus" placeholder="" style="width: 250px;" />
</el-row>
<el-row>
<el-button
v-if="dialogTitle =='添加班组信息'?true :false"
style="float: right;"
type="primary"
@click="handleAddYhxxComplated"
>添加
</el-button>
<el-button
v-if="dialogTitle =='修改班组信息'?true :false"
style="float: right;"
type="primary"
@click="handleUpdateYhxxComplated"
>修改
</el-button>
</el-row>
</el-row>
</el-dialog>
</el-col>
<el-col :span="8" style="border-left:1px solid rgb(230, 230, 230);height:100%;" >
<div style="color:#909399;font-size: 15px;height: 9%">
<div style="width: 100%;height: 50%;line-height: 200%;text-align: right;padding-right:3%" >
当前组织生效人员
</div>
<!-- <div style="float: right;">-->
<!-- <el-button style="margin: 1px;" type="primary" @click="changeTeam"></el-button>-->
<!-- </div>-->
</div>
<el-table
ref="bzryTable"
class="bzryTable"
:show-overflow-tooltip="true"
:data="bzryTableData"
height="calc(100% - 30px - 35px)"
width="100%"
:border="true"
highlight-current-row
>
<el-table-column label="" property="isselect" min-width="40">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.isselect" />
</template>
</el-table-column>
<el-table-column label="序号" type="index" />
<el-table-column label="人员编码" property="userCode" />
<el-table-column label="人员姓名" property="userName" />
<el-table-column label="是否资源" property="resource" />
<el-table-column label="班组长" property="foreman" />
<el-table-column label="所属资源组" property="resourcesCode" />
<el-table-column label="人员职务" property="position" />
<el-table-column label="人员属性" property="attribute" />
<el-table-column label="状态" property="flagStatus" />
</el-table>
</el-col>
<tbfilter ref="tbFilter" :list="c_yhxxTableData" :filter="columnFilter" @execFilter="execFilter" />
</el-container>
</template>
<script>
import {
addRoleForUser,
deleteRoleForUser
} from '@/api/sy/yhgl'
import {
getList,
update,
save,
del,
getBzryList
} from '@/api/sjzx/bzzGL'
import tbfilter from '@/components/TableColumnFilter'
export default {
name: 'Bzzzgl',
components: { tbfilter },
data() {
return {
defaultHeight: {
height: '100%'
},
inputDisabled:true,
activeGzzxxTabName: 'gzzxx',
dm_depart: [],
query: {resourcesCode:''},
yhxxTableData: [],
isYhxxTableLoading: true,
bzryTableData: [],
currentPage: 1,
pageSize: 100,
selectYhxx: {},
dialogVisible: false,
dialogTitle: '',
updateData: {},
columnFilter: {},
loginType:[{
value: 1,
label: '指纹登录'
}, {
value: 2,
label: 'findTxTl'
}, ],
}
},
computed: {
c_yhxxTableData: function() {
const search = this.query
let resultList = this.yhxxTableData
if (search && search.resourcesCode) {
resultList = resultList.filter(data => {
return Object.keys(data).some(key => {
return String(data[key]).indexOf(search.resourcesCode) > -1
})
})
}
if (search && search.resourcesName) {
resultList = resultList.filter(data => {
return Object.keys(data).some(key => {
return String(data[key]).indexOf(search.resourcesName) > -1
})
})
}
if (this.$refs.tbFilter) {
return this.$refs.tbFilter.doFilter(this.columnFilter, resultList)
}
return resultList
}
},
created() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
getList({}).then(response => {
this.yhxxTableData = response.data
this.$refs.bzxxTable.setCurrentRow(this.yhxxTableData[0])
getBzryList({resourcesCode:this.yhxxTableData[0].resourcesCode}).then(response => {
this.bzryTableData = response.data
})
})
},
methods: {
showFilter(column) {
this.$refs.tbFilter.showFilter(column)
},
execFilter(property, vals) {
this.currentPage = 1
this.$set(this.columnFilter, property, vals)
},
getHeight() {
this.defaultHeight.height = window.innerHeight - 140 + 'px'
},
handleSizeChange(val) {
this.pageSize = val
},
handleCurrentChange(val) {
this.currentPage = val
},
handleYhxxCurrentChange(currentRow) {
if (!currentRow || !currentRow.resourcesCode) return
this.selectYhxx = currentRow
getBzryList({resourcesCode:currentRow.resourcesCode}).then(response => {
this.bzryTableData = response.data
})
},
handleGzzSelect(row) {
if (!this.selectYhxx || !this.selectYhxx.yhdm) {
this.$message({ message: '请先选择一个用户!', type: 'error' })
return
}
const relation = { 'yhdm': this.selectYhxx.yhdm,
'role_code': row.role_code,
'yhms': this.selectYhxx.yhms
}
if (row.isselect) {
addRoleForUser([relation]).then(response => {
this.$message({ message: '添加角色成功!', type: 'success' })
})
} else {
deleteRoleForUser([relation]).then(response => {
this.$message({ message: '删除角色成功!', type: 'success' })
})
}
},
handleAddYhxx() {
this.dialogVisible = true
this.inputDisabled=false;
this.dialogTitle = '添加班组信息'
this.updateData = {}
},
handleAddYhxxComplated() {
var uuid = guid();
this.updateData.id = uuid;
save(this.updateData).then(response => {
this.updateData = JSON.parse(JSON.stringify(this.updateData))
this.yhxxTableData.push(this.updateData)
this.dialogVisible = false
this.$message({ message: '添加班组信息成功!', type: 'success' })
})
},
handleUpdateYhxx() {
if (!this.selectYhxx.resourcesCode) {
this.$message({ message: '请选择要修改的班组!', type: 'error' })
return
}
this.dialogVisible = true
this.dialogTitle = '修改班组信息'
console.log(this.selectYhxx)
this.updateData = JSON.parse(JSON.stringify(this.selectYhxx))
this.inputDisabled=true;
},
handleUpdateYhxxComplated() {
update(this.updateData).then(response => {
for (const key in this.updateData) {
this.selectYhxx[key] = this.updateData[key]
}
this.dialogVisible = false
this.$message({ message: '修改班组信息成功!', type: 'success' })
})
},
handleDeleteYhxx() {
let resultList = this.yhxxTableData.filter(data => {
return data.checked
})
if (!resultList.length>0){
this.$message({ message: '请选择要删除的班组!', type: 'error' })
return
}
this.$confirm('此操作将删除该班组, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
del(resultList).then(response => {
this.yhxxTableData = this.yhxxTableData.filter(
t => !t.checked
)
this.$message({ message: '删除班组信息成功!', type: 'success' })
})
})
},
changeTeam(){
let resultList = this.bzryTableData.filter(data => {
return data.isselect
})
if (!resultList.length>0){
this.$message({ message: '请选择要转组织的人员!', type: 'error' })
return
}
},
getDepartName(depart_code) {
for (const i in this.dm_depart) {
if (this.dm_depart[i].depart_code === depart_code) {
return this.dm_depart[i].depart_name
}
}
return ''
},
}
}
//uuid
function S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
function guid() {
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}
</script>
<style scoped>
.YhxxDialog .el-row {
margin-bottom: 5px;
}
</style>
Loading…
Cancel
Save