Browse Source

工具 2022年12月23日 sxm

master
[li_she] 3 years ago
parent
commit
b5f3ce08cb
  1. 218
      src/views/modules/base/partDistribution.vue

218
src/views/modules/base/partDistribution.vue

@ -1,8 +1,11 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
<el-button @click="getData()" type="primary" style="margin-left: 2px;margin-top: 0px">{{buttons.search}}</el-button>
<el-button @click="addModal()" :disabled = "authAdd" type="primary" style="margin-left: 2px;margin-top: 0px">{{buttons.add}}</el-button>
<el-button @click="getData()" type="primary" style="margin-left: 2px;margin-top: 0px">{{ buttons.search }}
</el-button>
<el-button @click="addModal()" :disabled="authAdd" type="primary" style="margin-left: 2px;margin-top: 0px">
{{ buttons.add }}
</el-button>
<el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button>
<el-button v-if="isAuth('sys:setting')" @click="saveColumnList()" type="primary">{{ buttons.defaultTable }}
</el-button>
@ -33,8 +36,8 @@
width="150"
:label=buttons.work>
<template slot-scope="scope">
<a type="text" size="small" :disabled = "authEdit" @click="editModel(scope.row)">{{buttons.update}}</a>
<a type="text" size="small" :disabled = "authDelete" @click="deleteData(scope.row)">{{buttons.delete}}</a>
<a type="text" size="small" :disabled="authEdit" @click="editModel(scope.row)">{{ buttons.update }}</a>
<a type="text" size="small" :disabled="authDelete" @click="deleteData(scope.row)">{{ buttons.delete }}</a>
</template>
</el-table-column>
<el-table-column
@ -48,19 +51,20 @@
: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.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>
<el-dialog :title=buttons.dataUpdate :close-on-click-modal="false" v-drag :visible.sync="modelFlag" width="500px" >
<el-dialog :title=buttons.dataUpdate :close-on-click-modal="false" v-drag :visible.sync="modelFlag" width="500px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label=buttons.site>
<el-input v-model="modelData.site" :disabled="modelInputFlag" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label=buttons.familyID>
<el-input v-model="modelData.familyID" :disabled="modelInputFlag" style="width: 130px" onblur="this.value=this.value.toUpperCase()"></el-input>
<el-input v-model="modelData.familyID" :disabled="modelInputFlag" style="width: 130px"
onblur="this.value=this.value.toUpperCase()"></el-input>
</el-form-item>
<el-form-item :label=buttons.familyName>
<el-input v-model="modelData.familyName" style="width: 130px"></el-input>
@ -76,10 +80,13 @@
<el-form-item :label=buttons.checkPercentage>
<el-input v-model="modelData.checkPercentage" type="number" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'是否检验附件'">
<el-checkbox style="width: 100px;" v-model="modelData.inspectFlag"></el-checkbox>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="ModelSave()">{{buttons.save}}</el-button>
<el-button type="primary" @click="modelFlag = false">{{buttons.close}}</el-button>
<el-button type="primary" @click="ModelSave()">{{ buttons.save }}</el-button>
<el-button type="primary" @click="modelFlag = false">{{ buttons.close }}</el-button>
</el-footer>
</el-dialog>
@ -89,8 +96,8 @@
</template>
<script>
import column from "../common/column";
import {
import column from "../common/column";
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
@ -100,21 +107,22 @@
saveSysLanguageOne,
searchPageLanguageData,
removerLanguage
} from "@/api/sysLanguage.js"
import {
} from "@/api/sysLanguage.js"
import {
getPartFamily,
savePartFamily,
deletePartFamily
} from "@/api/base/site.js"
import {
} from "@/api/base/site.js"
import {
saveTableDefaultList,
saveTableUser,
getTableDefaultListLanguage,
getTableUserListLanguage,
removerDefault,
removerUser
} from "@/api/table.js"
export default {
} from "@/api/table.js"
export default {
name: "partDistribution",
components: {column},
data() {
@ -252,7 +260,7 @@
tableId: "6002Table"
}
],
showDefault:false,
showDefault: false,
//
sysLanguageParams: [],
dataListLoading: false,
@ -265,25 +273,25 @@
status: true,
languageCode: this.$i18n.locale
},
buttons:{
defaultTable:'设置默认配置',
search:'查询',
add:'新增',
download:'导出',
buttons: {
defaultTable: '设置默认配置',
search: '查询',
add: '新增',
download: '导出',
settingTable: '设置列表',
work:'操作',
dataUpdate:'数据维护',
site:'工厂编码',
familyID:'分类编码',
familyName:'分类名称',
active:'在用',
update:'编辑',
delete:'删除',
yes:'是',
no:'否',
checkPercentage:'校验比例',
save:'保存',
close:'关闭',
work: '操作',
dataUpdate: '数据维护',
site: '工厂编码',
familyID: '分类编码',
familyName: '分类名称',
active: '在用',
update: '编辑',
delete: '删除',
yes: '是',
no: '否',
checkPercentage: '校验比例',
save: '保存',
close: '关闭',
},
// table
queryTable: {
@ -293,28 +301,29 @@
},
languageList: [],
queryLanguage: {},
visible:false,
visible: false,
// end
// start
exportData: [],
exportName: "物料分类"+this.dayjs().format('YYYYMMDDHHmmss'),
exportName: "物料分类" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["物料分类"],
exportFooter: [],
// end
height: 200,
modelFlag:false,
modelInputFlag:true,
selectList:[],
modelFlag: false,
modelInputFlag: true,
selectList: [],
modelData: {
add:'',
site:'',
familyID:'',
familyName:'',
active:'',
checkPercentage:'',
user:'',
},
dataList:[],
add: '',
site: '',
familyID: '',
familyName: '',
active: '',
checkPercentage: '',
user: '',
inspectFlag: ''
},
dataList: [],
columnList: [
{
userId: this.$store.state.user.name,
@ -467,7 +476,7 @@
//
getTableUserColumn() {
getTableUserListLanguage(this.queryTableUser).then(({data}) => {
if (data.rows.length>0) {
if (data.rows.length > 0) {
//this.columnList = []
this.columnList = data.rows
} else {
@ -500,7 +509,7 @@
// tableDefault
getColumnList() {
getTableDefaultListLanguage(this.queryTable).then(({data}) => {
if (data.rows.length>0) {
if (data.rows.length > 0) {
// this.showDefault = false
this.columnList = data.rows
} else {
@ -509,70 +518,71 @@
})
},
// end
getData(){
let inData={
user:this.$store.state.user.name
getData() {
let inData = {
user: this.$store.state.user.name
}
getPartFamily(inData).then(({data}) => {
this.dataList = data.rows
})
},
addModal(){
this.modelData={
add:'',
site:this.$store.state.user.site,
familyID:'',
familyName:'',
active:'',
checkPercentage:'',
user:'',
addModal() {
this.modelData = {
add: '',
site: this.$store.state.user.site,
familyID: '',
familyName: '',
active: '',
checkPercentage: '',
user: '',
}
this.modelData.add=0;
this.modelInputFlag=false;
this.modelData.active='Y';
this.modelFlag=true;
},
editModel(row){
this.modelData=JSON.parse(JSON.stringify(row));
this.modelData.add=1;
this.modelInputFlag=true;
this.modelFlag=true;
},
ModelSave(){
if(this.modelData.familyID==''||this.modelData.familyID==null){
this.$alert("请输入分类编码!",'错误',{
confirmButtonText:'确定'
this.modelData.add = 0;
this.modelInputFlag = false;
this.modelData.active = 'Y';
this.modelFlag = true;
},
editModel(row) {
this.modelData = JSON.parse(JSON.stringify(row));
this.modelData.inspectFlag = this.modelData.inspectFlag=='Y'?true:false
this.modelData.add = 1;
this.modelInputFlag = true;
this.modelFlag = true;
},
ModelSave() {
if (this.modelData.familyID == '' || this.modelData.familyID == null) {
this.$alert("请输入分类编码!", '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.modelData.familyName==''||this.modelData.familyName==null){
this.$alert("请输入分类名称!",'错误',{
confirmButtonText:'确定'
if (this.modelData.familyName == '' || this.modelData.familyName == null) {
this.$alert("请输入分类名称!", '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.modelData.active==''||this.modelData.active==null){
this.$alert("请选择是否在用!",'错误',{
confirmButtonText:'确定'
if (this.modelData.active == '' || this.modelData.active == null) {
this.$alert("请选择是否在用!", '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.modelData.site==''||this.modelData.site==null){
this.$alert("请输入工厂编码!",'错误',{
confirmButtonText:'确定'
if (this.modelData.site == '' || this.modelData.site == null) {
this.$alert("请输入工厂编码!", '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.modelData.checkPercentage==''||this.modelData.checkPercentage==null){
this.modelData.checkPercentage=0;
if (this.modelData.checkPercentage == '' || this.modelData.checkPercentage == null) {
this.modelData.checkPercentage = 0;
}
this.modelData.user=this.$store.state.user.name;
this.modelData.user = this.$store.state.user.name;
this.modelData.inspectFlag = this.modelData.inspectFlag ? 'Y' : 'N'
savePartFamily(this.modelData).then(({data}) => {
if (data && data.code == 200) {
this.modelFlag = false
this.getData();
this.$message.success( '操作成功')
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@ -580,7 +590,7 @@
}
})
},
deleteData(row){
deleteData(row) {
this.$confirm(`是否删除此条物料分类?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -589,7 +599,7 @@
}).then(() => {
let inData = {
familyID: row.familyID,
site:row.site
site: row.site
}
deletePartFamily(inData).then(({data}) => {
if (data && data.code == 200) {
@ -633,12 +643,12 @@
},
// end
//
getButtonAuthData(){
let updateFlag = this.isAuth(this.menuId+":revise");
let fullControFlag = this.isAuth(this.menuId+":fullContro");
let deleteFlag = this.isAuth(this.menuId+":remove");
getButtonAuthData() {
let updateFlag = this.isAuth(this.menuId + ":revise");
let fullControFlag = this.isAuth(this.menuId + ":fullContro");
let deleteFlag = this.isAuth(this.menuId + ":remove");
//
this.authEdit = !updateFlag ||!fullControFlag;
this.authEdit = !updateFlag || !fullControFlag;
this.authAdd = !fullControFlag;
this.authDelete = !deleteFlag;
},
@ -652,11 +662,11 @@
//
this.getButtonAuthData();
}
}
}
</script>
<style >
.el-textarea__inner {
<style>
.el-textarea__inner {
padding: 5px 5px;
}
}
</style>
Loading…
Cancel
Save