fix:日志添加班组

This commit is contained in:
shijing 2025-04-23 10:53:36 +08:00
parent 54d1464e74
commit 249af1897c
2 changed files with 125 additions and 24 deletions

View File

@ -40,23 +40,25 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="操作员"> <el-form-item label="班组">
<el-select <el-select
v-model="form.handle_user" v-model="form.team"
placeholder="操作员" placeholder="班组"
clearable :disabled="mode == 'edit'"
filterable style="width: 100%"
class="width100" @change="teamChange"
> >
<el-option <el-option
v-for="item in userList" v-for="item in teamOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
></el-option> >
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="生产设备"> <el-form-item label="生产设备">
<el-select <el-select
@ -79,6 +81,24 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="操作员">
<el-select
v-model="form.handle_user"
placeholder="操作员"
clearable
filterable
class="width100"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="班次"> <el-form-item label="班次">
<el-select <el-select
v-model="form.shift" v-model="form.shift"
@ -96,7 +116,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :md="12" :sm="12" :xs="24" v-for="item in testitems" :key="item.id"> <el-col :md="12" :sm="12" :xs="24" v-for="item in testitems" :key="item.id">
<el-form-item :label="item.name"> <el-form-item :label="item.name">
<el-input-number <el-input-number
@ -363,6 +383,7 @@ export default {
options: [], options: [],
testitems:[], testitems:[],
qct_defects:[], qct_defects:[],
teamOptions:[],
routeOptions: [], routeOptions: [],
supplierOptions: [], supplierOptions: [],
materialOptions:[], materialOptions:[],
@ -378,6 +399,21 @@ export default {
this.form.handle_date = this.$TOOL.dateFormat2(new Date());; this.form.handle_date = this.$TOOL.dateFormat2(new Date());;
}, },
methods: { methods: {
getTeam() {
let that = this;
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
that.$API.mtm.team.list.req(form).then((res) => {
that.teamOptions = res;
});
},
teamChange(){
let that = this;
that.$API.mtm.teammember.list.req({team:that.form.team,page:0}).then((res) => {
that.userOptions = res;
});
},
// //
gettestitem(){ gettestitem(){
let that = this; let that = this;
@ -404,6 +440,7 @@ export default {
that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => { that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => {
that.deptId = res.belong_dept; that.deptId = res.belong_dept;
that.mgroupName = res.name; that.mgroupName = res.name;
this.getTeam();
that.getEquipment(); that.getEquipment();
that.getUserList(); that.getUserList();
}); });

View File

@ -77,23 +77,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="生产设备"> <el-form-item label="班组">
<el-select <el-select
v-model="form.equipment" v-model="form.team"
placeholder="生产设备" placeholder="班组"
clearable
filterable
:disabled="mode == 'edit'" :disabled="mode == 'edit'"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in options" v-for="item in teamOptions"
:key="item.id" :key="item.id"
:label="item.label" :label="item.name"
:value="item.id" :value="item.id"
> >
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -137,13 +133,50 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="操作人"> <el-form-item label="操作人">
<ehsSelect <el-select
v-model="form.handle_user"
placeholder="操作人"
:disabled="mode == 'edit'"
style="width: 100%"
filterable
>
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<!-- <ehsSelect
v-model="form.handle_user" v-model="form.handle_user"
:showName="form.handle_user_name" :showName="form.handle_user_name"
:apiObj="this.$API.system.user.list" :apiObj="this.$API.system.user.list"
:params="{ depts: dept }" :params="{ depts: dept }"
style="width: 100%;" style="width: 100%;"
></ehsSelect> ></ehsSelect> -->
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
placeholder="生产设备"
clearable
filterable
:disabled="mode == 'edit'"
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.label"
:value="item.id"
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 黑化 --> <!-- 黑化 -->
@ -341,6 +374,7 @@ export default {
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [], options: [],
teamOptions:[],
routeOptions: [], routeOptions: [],
userOptions: [], userOptions: [],
supplierOptions: [], supplierOptions: [],
@ -348,8 +382,9 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getUser();
this.getRoute(); this.getRoute();
// this.getUser(); this.getTeam();
this.getSupplier(); this.getSupplier();
this.getEquipment(); this.getEquipment();
this.gettestitem(); this.gettestitem();
@ -358,6 +393,21 @@ export default {
}, },
methods: { methods: {
getTeam() {
let that = this;
let form = {};
form.page = 0;
form.belong_dept = this.dept;
that.$API.mtm.team.list.req(form).then((res) => {
that.teamOptions = res;
});
},
teamChange(){
let that = this;
that.$API.mtm.teammember.list.req({team:that.form.team,page:0}).then((res) => {
that.userOptions = res;
});
},
// //
gettestitem(){ gettestitem(){
let that = this; let that = this;
@ -373,10 +423,24 @@ export default {
disabledDateFn(time) { disabledDateFn(time) {
return time.getTime() > new Date().getTime(); return time.getTime() > new Date().getTime();
}, },
// // //
getUser() { getUser() {
this.$API.system.user.list.req({ depts: this.dept }).then((res) => { let that = this;
this.userOptions = res.results; let userInfo = that.$TOOL.data.get("USER_INFO");
this.$API.system.user.list.req({ depts: that.dept, page: 0 }).then((res) => {
that.userOptions = res;
let arr = res.filter(item=>{
return item.id==userInfo.id;
})
if(arr.length>0){
that.form.handle_user = userInfo.id;
}else{
let obj = {};
obj.id = userInfo.id;
obj.name = userInfo.name;
that.userOptions.push(obj)
that.form.handle_user = userInfo.id;
}
}); });
}, },
getEquipment() { getEquipment() {