fix:扭转工段mlog中不填设备和人员;mlogb中选择设备、操作人、开始时间和结束时间

This commit is contained in:
shijing 2025-04-02 13:30:02 +08:00
parent 1bfb826443
commit 7afdc70107
3 changed files with 158 additions and 60 deletions

View File

@ -727,6 +727,9 @@ export default {
//
mlogSubmit() {
let that = this;
if(that.mlogItem.work_end_time==''||that.mlogItem.work_end_time==null){
that.mlogItem.handle_date = that.$TOOL.dateFormat2(new Date());
}
that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => {
that.isSaveing = false;
that.visible = false;

View File

@ -96,7 +96,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24" v-if="route_code!=='niuzhuan'">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
@ -172,7 +172,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24" v-if="route_code!=='niuzhuan'">
<el-form-item
label="开始时间"
prop="work_start_time"
@ -187,8 +187,7 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24" v-if="route_code!=='niuzhuan'">
<el-form-item label="结束时间" prop="work_end_time">
<el-date-picker
v-model="form.work_end_time"
@ -306,6 +305,13 @@ export default {
trigger: "blur",
},
],
work_end_time: [
{
required: true,
message: "请选择结束时间",
trigger: "blur",
},
],
route: [
{
required: true,
@ -326,6 +332,7 @@ export default {
{ id: 20, name: "外协" },
],
mlogtype:"",
route_code:"",
visible: false,
isSaveing: false,
options: [],
@ -338,6 +345,8 @@ export default {
};
},
mounted() {
this.route_code = this.$route.path.split("/")[2];
this.form.work_start_time = this.$TOOL.dateFormat(new Date());
this.getRoute();
this.getUser();
this.getSupplier();

View File

@ -17,63 +17,134 @@
label-width="80px"
style="padding: 0 10px"
>
<el-form-item label="关联任务" v-if="!isfix">
<el-select
v-model="form.mtask"
placeholder="关联任务"
clearable
style="width: 100%"
@change="getMaterial"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
<el-row>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="关联任务" v-if="!isfix">
<el-select
v-model="form.mtask"
placeholder="关联任务"
clearable
class="width-100"
@change="getMaterial"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="批次选择">
<el-select
v-model="batchs"
placeholder="批次选择"
clearable
class="width-100"
@change="changeMaterial"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="物料扫码" style="display: flex;">
<scScanner @scanResult="formWminChange"></scScanner>
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)" style="width: 200px;margin-left: 4px;"></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="使用数量" prop="count_use">
<el-input-number ref="codeInput" v-model="form.count_use" :min="0" clearable class="width-100"></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24" v-if="route_code=='niuzhuan'">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
placeholder="生产设备"
clearable
filterable
style="width: 100%"
>
<el-option
v-for="item in optionsEq"
: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-col>
<el-col :md="12" :sm="12" :xs="24" v-if="route_code=='niuzhuan'">
<el-form-item label="操作人">
<ehsSelect
v-model="form.handle_user"
:showName="form.handle_user_name"
:apiObj="this.$API.system.user.list"
:params="{ depts: dept }"
class="width-100"
></ehsSelect>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24" v-if="route_code=='niuzhuan'">
<el-form-item
label="开始时间"
prop="work_start_time"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="批次选择">
<el-select
v-model="batchs"
placeholder="批次选择"
clearable
style="width: 100%"
@change="changeMaterial"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="物料扫码" style="display: flex;">
<scScanner @scanResult="formWminChange"></scScanner>
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)" style="width: 200px;margin-left: 4px;"></el-input>
</el-form-item>
<el-form-item label="使用数量" prop="count_use">
<el-input-number ref="codeInput" v-model="form.count_use" :min="0" clearable></el-input-number>
</el-form-item>
<el-form-item label="主要批次" v-if="!isfix">
<el-select
v-model="form.parent"
placeholder="主要批次"
clearable
style="width: 100%"
>
<el-option
v-for="item in mlogbInOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-date-picker
:disabled="mode == 'edit'"
v-model="form.work_start_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
popper-append-to-body
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24" v-if="route_code=='niuzhuan'">
<el-form-item label="结束时间" prop="work_end_time">
<el-date-picker
v-model="form.work_end_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
:disabledDate="disabledDateFn"
popper-append-to-body
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="主要批次" v-if="!isfix">
<el-select
v-model="form.parent"
placeholder="主要批次"
clearable
class="width-100"
>
<el-option
v-for="item in mlogbInOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
@ -144,8 +215,10 @@ export default {
]
},
wm_in:'',
route_code:"",
mlogbIns:[],
options: [],
optionsEq: [],
mlogbInOptions:[],
materialOptions: [],
mgroup_code:'',
@ -168,6 +241,7 @@ export default {
};
},
mounted() {
this.route_code = this.$route.path.split("/")[2];
this.form.mlog = this.mlog;
this.params.mlog = this.mlog;
let arr = this.$route.path.split("/");
@ -176,6 +250,7 @@ export default {
this.getMtask();
this.getMaterial();
this.getParentList();
this.getEquipment();
},
methods: {
open() {
@ -195,6 +270,17 @@ export default {
that.mlogbIns = res;
})
},
getEquipment() {
let that = this;
this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => {
res.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.label = item.name+'-'+item.number;
that.optionsEq.push(obj);
});
});
},
getParentList(){
let that = this;
that.$API.wpm.mlogb.list.req(that.params).then((res) => {