Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
a56d5cbf82
|
@ -3,11 +3,11 @@
|
|||
<el-icon><el-icon-menu /></el-icon>
|
||||
</div>
|
||||
|
||||
<el-drawer ref="mobileNavBox" title="移动端菜单" :size="240" v-model="nav" direction="ltr" :with-header="false"
|
||||
<el-drawer ref="mobileNavBox" title="移动端菜单" id="mobileNavBox" :size="240" v-model="nav" direction="ltr" :with-header="false"
|
||||
destroy-on-close>
|
||||
<el-container class="mobile-nav">
|
||||
<el-header>
|
||||
<div class="logo-bar"><img class="logo" :src="baseLogo"><span>{{ baseName }}</span>></div>
|
||||
<div class="logo-bar"><img class="logo" :src="baseLogo"><span>{{ baseName }}</span></div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-scrollbar>
|
||||
|
|
|
@ -352,7 +352,9 @@ body .tox-tinymce-aux {
|
|||
overflow: auto;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
#mobileNavBox .el-drawer__body{
|
||||
padding: 0;
|
||||
}
|
||||
.el-form--label-top .el-form-item__label {
|
||||
line-height: 16px;
|
||||
}
|
||||
|
|
|
@ -1,28 +1,11 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<!-- <div class="left-panel">
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">
|
||||
报废</el-button>
|
||||
</div> -->
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">
|
||||
返工交接</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<!-- <el-button type="primary" @click="materialsChoses('wm')"
|
||||
>选择物料</el-button
|
||||
> -->
|
||||
<!-- <el-select
|
||||
v-model="query.mgroupx"
|
||||
placeholder="工段"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
style="width: 250px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select> -->
|
||||
<el-input
|
||||
style="margin-right: 5px;width: 250px"
|
||||
v-model="query.search"
|
||||
|
@ -90,47 +73,37 @@
|
|||
prop="create_time"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="70"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-link type="primary" v-auth="'handover.create'" @click="table_add(20,scope.row)">交接</el-link>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</scTable>
|
||||
</el-main>
|
||||
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
|
||||
<materials
|
||||
style="height: 500px"
|
||||
:materialType="materialType"
|
||||
ref="materialsChose"
|
||||
@choseChange="choseChange"
|
||||
></materials>
|
||||
</el-dialog>
|
||||
<scrap-dialog
|
||||
v-if="dialog.scrap"
|
||||
ref="scrapDialog"
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:type="type"
|
||||
:mgroupName="mgroupName"
|
||||
:mgroupId="mgroupId"
|
||||
@success="handleScrapSuccess"
|
||||
@closed="dialog.scrap = false"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
>
|
||||
</scrap-dialog>
|
||||
</save-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "../wpm_gx/handover_form.vue";
|
||||
import { wmState } from "@/utils/enum.js";
|
||||
// import materials from "./../mtm/materials.vue";
|
||||
// import checkDialog from "./check_form.vue";
|
||||
// import showDrawer from "./check_drawer.vue";
|
||||
// import scrapDialog from "./handover_form.vue";
|
||||
export default {
|
||||
props: {
|
||||
mgroupName: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
components: {
|
||||
saveDialog
|
||||
},
|
||||
// components: {
|
||||
// materials,
|
||||
// checkDialog,
|
||||
// showDrawer,
|
||||
// scrapDialog
|
||||
// },
|
||||
name: "wmaterial",
|
||||
data() {
|
||||
return {
|
||||
|
@ -140,69 +113,38 @@ export default {
|
|||
state : 50,
|
||||
state_all: 1
|
||||
},
|
||||
query: {
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
query:{
|
||||
search:''
|
||||
},
|
||||
dialog: {
|
||||
scrap: false,
|
||||
},
|
||||
options:[],
|
||||
tableData: [],
|
||||
selection: [],
|
||||
queryWm: {
|
||||
search: "",
|
||||
material: "",
|
||||
},
|
||||
materialType: "wm",
|
||||
visibleDrawer: false,
|
||||
type:20,
|
||||
mgroupName:'废品库',
|
||||
mgroupId:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
// that.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
|
||||
// that.options = res;
|
||||
// if(res.length>0){
|
||||
// that.params.mgroupx = res[0].id;
|
||||
// }
|
||||
// });
|
||||
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
|
||||
that.mgroupOptions = res;
|
||||
res.forEach(item=>{
|
||||
if(item.name=="废品库"){
|
||||
that.mgroupId = item.id;
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
materialsChoses(str) {
|
||||
this.materialType = str;
|
||||
this.materialsVisible = true;
|
||||
},
|
||||
choseChange(data) {
|
||||
this.queryWm.material = data;
|
||||
this.$refs.table_wm.queryData(this.queryWm);
|
||||
this.materialsVisible = false;
|
||||
},
|
||||
tomio() {
|
||||
this.$router.push({ name: "halfgood_mio" });
|
||||
},
|
||||
table_Check(row){
|
||||
this.checkItem = row;
|
||||
let mode = this.mgroupName;
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open(mode);
|
||||
});
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
//添加报废
|
||||
|
||||
//添加
|
||||
table_add(type) {
|
||||
this.dialog.scrap = true;
|
||||
this.dialog.save = true;
|
||||
this.type = type;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.scrapDialog.open("add");
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
handleScrapSuccess(){
|
||||
this.dialog.scrap = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
//搜索
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
|
|
|
@ -39,29 +39,26 @@
|
|||
<el-table-column
|
||||
label="名称"
|
||||
prop="name"
|
||||
min-width="100"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column label="编号" prop="code" min-width="100"></el-table-column> -->
|
||||
<el-table-column
|
||||
label="大类"
|
||||
prop="cate"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="批号追加设备" min-width="60" v-if="baseCode!=='bxerp'">
|
||||
<el-table-column
|
||||
label="类型"
|
||||
prop="type"
|
||||
>
|
||||
<template #default="scope">{{ types[scope.row.type] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批号追加设备" v-if="baseCode!=='bxerp'">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.batch_append_equip">
|
||||
是
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否自检" min-width="60" v-if="baseCode =='bxerp'">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.into_wm_mgroup">
|
||||
是
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交接到工段" min-width="60">
|
||||
<el-table-column label="交接到工段">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.into_wm_mgroup">
|
||||
是
|
||||
|
@ -71,7 +68,7 @@
|
|||
</el-icon> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格品是否入库" min-width="60">
|
||||
<el-table-column label="不合格品是否入库">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.store_notok">
|
||||
是
|
||||
|
@ -81,7 +78,7 @@
|
|||
</el-icon> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" prop="sort" min-width="60">
|
||||
<el-table-column label="排序" prop="sort">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
|
@ -151,6 +148,10 @@ export default {
|
|||
50: "加工工具",
|
||||
60: "辅助工装",
|
||||
},
|
||||
types:{
|
||||
'PRO_PROD':'生产工序',
|
||||
'PRO_TEST':'检验工序',
|
||||
},
|
||||
baseCode :this.$TOOL.data.get('BASE_INFO').base.base_code
|
||||
};
|
||||
},
|
||||
|
|
|
@ -22,6 +22,20 @@
|
|||
<el-form-item label="大类">
|
||||
<el-input v-model="form.cate" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工序类型">
|
||||
<el-select
|
||||
v-model="form.type"
|
||||
placeholder="工序类型"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in processOptions"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门" v-if="baseCode!=='bxerp'">
|
||||
<el-select
|
||||
v-model="form.belong_dept"
|
||||
|
@ -45,13 +59,13 @@
|
|||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="baseCode=='bxerp'">
|
||||
<!-- <el-col :span="12" v-if="baseCode=='bxerp'">
|
||||
<el-form-item label="是否自检">
|
||||
<el-switch
|
||||
v-model="form.into_wm_mgroup"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="交接到工段">
|
||||
<el-switch
|
||||
|
@ -91,6 +105,7 @@
|
|||
const defaultForm = {
|
||||
name: "",
|
||||
cate: "",
|
||||
type:'PRO_PROD',
|
||||
belong_dept: "",
|
||||
into_wm_mgroup: true,
|
||||
store_notok: true,
|
||||
|
@ -114,6 +129,10 @@ export default {
|
|||
{ required: true, message: "请输入名称", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
processOptions:[
|
||||
{name:'生产工序',value:'PRO_PROD'},
|
||||
{name:'检验工序',value:'PRO_TEST'},
|
||||
],
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
deptOptions: [],
|
||||
|
|
|
@ -0,0 +1,195 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="tableAdd" v-auth="'role.create'"></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-input v-model="query.search" placeholder="检验表名称" clearable @keyup.enter="handleQuery"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" hidePagination>
|
||||
<el-table-column type="selection" width="50"></el-table-column>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="名称" prop="name" min-width="100"></el-table-column>
|
||||
<el-table-column label="标识" prop="code" min-width="100"></el-table-column>
|
||||
<el-table-column label="描述" prop="description" min-width="150"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="roleEdit(scope.row, scope.$index)" v-auth="'role.update'" type="primary">编辑</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="roleDel(scope.row, scope.$index)">
|
||||
<template #reference>
|
||||
<el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<el-dialog :title="titleMap[type]" v-model="limitedVisible" :width="600">
|
||||
<el-form :model="addForm" :rules="rules" ref="addForm" autocomplete ="off" label-width="100px" label-position="left">
|
||||
<el-form-item label="名称" prop="name" auto>
|
||||
<el-input v-model="addForm.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标识">
|
||||
<el-input v-model="addForm.code" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述">
|
||||
<el-input v-model="addForm.description" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检验项">
|
||||
<el-input v-model="addForm.description" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="limitedVisible=false" >取 消</el-button>
|
||||
<el-button v-if="type!=='show'" type="primary" :loading="isSaving" @click="submitHandle()">保 存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
const defaultForm = {
|
||||
id:"",
|
||||
name: "",
|
||||
code: "",
|
||||
description: "",
|
||||
perms:[],
|
||||
};
|
||||
export default {
|
||||
name: 'dept',
|
||||
data() {
|
||||
return {
|
||||
apiObj:null,
|
||||
selection: [],
|
||||
checkList: [],
|
||||
search: {
|
||||
keyword: null
|
||||
},
|
||||
query: {},
|
||||
isSaving: false,
|
||||
limitedVisible : false,
|
||||
checkStrictly:true,
|
||||
type: "add",
|
||||
titleMap: {
|
||||
add: '新增',
|
||||
edit: '编辑',
|
||||
show: '查看'
|
||||
},
|
||||
|
||||
//表单数据
|
||||
addForm: defaultForm,
|
||||
//验证规则
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入名称'}
|
||||
],
|
||||
},
|
||||
menu: {
|
||||
list: [],
|
||||
checked: [],
|
||||
props: {
|
||||
emitPath: false,
|
||||
children: 'children',
|
||||
// label: 'name',
|
||||
/*label: (data)=>{
|
||||
return data.meta.title
|
||||
}*/
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTestItem();
|
||||
},
|
||||
methods: {
|
||||
//获取检验项
|
||||
getTestItem(){
|
||||
var res = this.$API.system.role.list.req();
|
||||
this.tableData = res.results;
|
||||
},
|
||||
//添加检验表
|
||||
tableAdd(){
|
||||
this.limitedVisible = true;
|
||||
this.type = "add";
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
})
|
||||
this.addForm = Object.assign({}, defaultForm);
|
||||
},
|
||||
//提交
|
||||
submitHandle(){
|
||||
let that = this;
|
||||
this.addForm.perms = this.menu.checked;
|
||||
this.$refs.addForm.validate( (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
let res;
|
||||
if(this.type==='add'){
|
||||
this.$API.system.role.create.req(that.addForm).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.limitedVisible = false;
|
||||
this.$refs.table.refresh();
|
||||
}).catch(e=>{this.isSaveing = false;})
|
||||
}else{
|
||||
this.$API.system.role.update.req(that.addForm.id,that.addForm).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.limitedVisible = false;
|
||||
this.$refs.table.refresh();
|
||||
}).catch(e=>{this.isSaveing = false;})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑检验表
|
||||
roleEdit(row){
|
||||
this.type='edit';
|
||||
this.addForm.id=row.id;
|
||||
this.addForm.name=row.name;
|
||||
this.addForm.code=row.code;
|
||||
this.addForm.description=row.description;
|
||||
this.limitedVisible = true;
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.menu.setCheckedKeys(row.perms)
|
||||
})
|
||||
},
|
||||
|
||||
//删除检验表
|
||||
async roleDel(row){
|
||||
var id = row.id;
|
||||
var res = await this.$API.system.role.delete.req(id);
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg)
|
||||
}else{
|
||||
this.$refs.table.refresh();
|
||||
this.$message.success("删除成功")
|
||||
}
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection){
|
||||
this.selection = selection;
|
||||
},
|
||||
//搜索
|
||||
handleQuery(){
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, type){
|
||||
if(type=='add'){
|
||||
this.$refs.table.refresh()
|
||||
}else if(type=='edit'){
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
|
||||
</style>
|
|
@ -0,0 +1,190 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="roleAdd" v-auth="'role.create'"></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-input v-model="query.search" placeholder="名称" clearable @keyup.enter="handleQuery"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" hidePagination>
|
||||
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="类型" prop="field_type" min-width="100"></el-table-column>
|
||||
<el-table-column label="描述" prop="description" min-width="100"></el-table-column>
|
||||
<el-table-column label="物料系列标签" prop="mcate_tags">
|
||||
<template #default="scope">
|
||||
<span v-for="item in scope.row.mcate_tags" :key="item">{{ item }}、</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="选项" prop="options">
|
||||
<template #default="scope">
|
||||
<div v-for="item in scope.row.options" :key="item">{{ item }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="roleEdit(scope.row, scope.$index)" v-auth="'role.update'" type="primary">编辑</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="roleDel(scope.row, scope.$index)">
|
||||
<template #reference>
|
||||
<el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<el-dialog :title="titleMap[type]" v-model="limitedVisible" :width="600">
|
||||
<el-form :model="addForm" :rules="rules" ref="addForm" autocomplete =‘off’ label-width="100px" label-position="left">
|
||||
<el-form-item label="名称" prop="name" auto>
|
||||
<el-input v-model="addForm.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标识">
|
||||
<el-input v-model="addForm.code" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述">
|
||||
<el-input v-model="addForm.description" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="limitedVisible=false" >取 消</el-button>
|
||||
<el-button v-if="type!=='show'" type="primary" :loading="isSaving" @click="submitHandle()">保 存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
const defaultForm = {
|
||||
id:"",
|
||||
name: "",
|
||||
code: "",
|
||||
description: "",
|
||||
perms:[],
|
||||
};
|
||||
export default {
|
||||
name: 'dept',
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.qm.testitem.list,
|
||||
selection: [],
|
||||
checkList: [],
|
||||
search: {
|
||||
keyword: null
|
||||
},
|
||||
query: {},
|
||||
isSaving: false,
|
||||
limitedVisible : false,
|
||||
checkStrictly:true,
|
||||
type: "add",
|
||||
titleMap: {
|
||||
add: '新增',
|
||||
edit: '编辑',
|
||||
show: '查看'
|
||||
},
|
||||
|
||||
//表单数据
|
||||
addForm: defaultForm,
|
||||
//验证规则
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入角色名称'}
|
||||
],
|
||||
},
|
||||
menu: {
|
||||
list: [],
|
||||
checked: [],
|
||||
props: {
|
||||
emitPath: false,
|
||||
children: 'children',
|
||||
// label: 'name',
|
||||
/*label: (data)=>{
|
||||
return data.meta.title
|
||||
}*/
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
//添加
|
||||
roleAdd(){
|
||||
this.limitedVisible = true;
|
||||
this.type = "add";
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
})
|
||||
this.addForm = Object.assign({}, defaultForm);
|
||||
},
|
||||
submitHandle(){
|
||||
let that = this;
|
||||
this.addForm.perms = this.menu.checked;
|
||||
this.$refs.addForm.validate( (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
let res;
|
||||
if(this.type==='add'){
|
||||
this.$API.qm.testitem.create.req(that.addForm).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.limitedVisible = false;
|
||||
this.$refs.table.refresh();
|
||||
}).catch(e=>{this.isSaveing = false;})
|
||||
}else{
|
||||
this.$API.qm.testitem.update.req(that.addForm.id,that.addForm).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.limitedVisible = false;
|
||||
this.$refs.table.refresh();
|
||||
}).catch(e=>{this.isSaveing = false;})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//编辑
|
||||
roleEdit(row){
|
||||
this.type='edit';
|
||||
this.addForm.id=row.id;
|
||||
this.addForm.name=row.name;
|
||||
this.addForm.code=row.code;
|
||||
this.addForm.description=row.description;
|
||||
this.limitedVisible = true;
|
||||
},
|
||||
|
||||
//删除
|
||||
async roleDel(row){
|
||||
var id = row.id;
|
||||
var res = await this.$API.qm.testitem.delete.req(id);
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg)
|
||||
}else{
|
||||
this.$refs.table.refresh();
|
||||
this.$message.success("删除成功")
|
||||
}
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection){
|
||||
this.selection = selection;
|
||||
},
|
||||
//搜索
|
||||
handleQuery(){
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, type){
|
||||
if(type=='add'){
|
||||
this.$refs.table.refresh()
|
||||
}else if(type=='edit'){
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
|
@ -322,12 +322,16 @@ export default {
|
|||
.then((res) => {
|
||||
that.userList = res;
|
||||
});
|
||||
}else if(that.type==20&&that.mgroupName=='废品库'){//废品交接
|
||||
that.getCkUserList();
|
||||
}else{
|
||||
that.deptID = that.$TOOL.data.get('gx_deptID');
|
||||
that.getUserList();
|
||||
}
|
||||
if(that.type==20||that.type==40){
|
||||
if((that.type==20&&that.mgroupName!=='废品库')||that.type==40){
|
||||
that.getMaterialNotok();
|
||||
}else if(that.type==20&&that.mgroupName=='废品库'){
|
||||
that.getMaterialFP();
|
||||
}else{
|
||||
that.getMaterial();
|
||||
}
|
||||
|
@ -348,15 +352,15 @@ export default {
|
|||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
|
||||
that.mgroupOptions = res;
|
||||
if(that.type==40){
|
||||
res.forEach(item=>{
|
||||
if(item.name=="废品库"){
|
||||
that.form.recive_mgroup = item.id;
|
||||
}
|
||||
})
|
||||
that.getCkUserList();//废品库接收人
|
||||
}
|
||||
});
|
||||
if(that.type==40){
|
||||
res.forEach(item=>{
|
||||
if(item.name=="废品库"){
|
||||
that.form.recive_mgroup = item.id;
|
||||
}
|
||||
})
|
||||
that.getCkUserList();//废品库接收人
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取车间物料
|
||||
getMaterial() {
|
||||
|
@ -366,6 +370,7 @@ export default {
|
|||
notok_sign__isnull : 1,
|
||||
count_xtest__isnull:1
|
||||
};
|
||||
that.materialOptions = [];
|
||||
if(that.mgroupName=="size"){
|
||||
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
|
@ -397,6 +402,7 @@ export default {
|
|||
//获取车间不合格物料
|
||||
getMaterialNotok() {
|
||||
let that = this;
|
||||
that.materialOptions = [];
|
||||
var req = {
|
||||
mgroupx: that.mgroupId,
|
||||
page: 0,
|
||||
|
@ -408,6 +414,19 @@ export default {
|
|||
that.materialOptions = res;
|
||||
});
|
||||
},
|
||||
//获取废品库物料
|
||||
getMaterialFP() {
|
||||
let that = this;
|
||||
that.materialOptions = [];
|
||||
var obj = {
|
||||
page: 0,
|
||||
state : 50,
|
||||
state_all: 1
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
},
|
||||
//获取交送工段人员
|
||||
getUserList() {
|
||||
let that = this;
|
||||
|
@ -420,7 +439,13 @@ export default {
|
|||
let that = this;
|
||||
this.$API.system.user.list.req({ page: 0, posts__code: "inm&check" })
|
||||
.then((res) => {
|
||||
that.userList2 = res;
|
||||
if(that.type==40){
|
||||
that.userList2 = [];
|
||||
that.userList2 = res;
|
||||
}else if(that.type==20&&that.mgroupName=='废品库'){
|
||||
that.userList = [];
|
||||
that.userList = res;
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取接收工段人员
|
||||
|
|
Loading…
Reference in New Issue