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() { mlogSubmit() {
let that = this; 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.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.visible = false; that.visible = false;

View File

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

View File

@ -17,12 +17,14 @@
label-width="80px" label-width="80px"
style="padding: 0 10px" style="padding: 0 10px"
> >
<el-row>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="关联任务" v-if="!isfix"> <el-form-item label="关联任务" v-if="!isfix">
<el-select <el-select
v-model="form.mtask" v-model="form.mtask"
placeholder="关联任务" placeholder="关联任务"
clearable clearable
style="width: 100%" class="width-100"
@change="getMaterial" @change="getMaterial"
> >
<el-option <el-option
@ -34,12 +36,14 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="批次选择"> <el-form-item label="批次选择">
<el-select <el-select
v-model="batchs" v-model="batchs"
placeholder="批次选择" placeholder="批次选择"
clearable clearable
style="width: 100%" class="width-100"
@change="changeMaterial" @change="changeMaterial"
> >
<el-option <el-option
@ -51,19 +55,84 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col>
<el-form-item label="物料扫码" style="display: flex;"> <el-form-item label="物料扫码" style="display: flex;">
<scScanner @scanResult="formWminChange"></scScanner> <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-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>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="使用数量" prop="count_use"> <el-form-item label="使用数量" prop="count_use">
<el-input-number ref="codeInput" v-model="form.count_use" :min="0" clearable></el-input-number> <el-input-number ref="codeInput" v-model="form.count_use" :min="0" clearable class="width-100"></el-input-number>
</el-form-item> </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-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-form-item label="主要批次" v-if="!isfix">
<el-select <el-select
v-model="form.parent" v-model="form.parent"
placeholder="主要批次" placeholder="主要批次"
clearable clearable
style="width: 100%" class="width-100"
> >
<el-option <el-option
v-for="item in mlogbInOptions" v-for="item in mlogbInOptions"
@ -74,6 +143,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button> <el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
@ -144,8 +215,10 @@ export default {
] ]
}, },
wm_in:'', wm_in:'',
route_code:"",
mlogbIns:[], mlogbIns:[],
options: [], options: [],
optionsEq: [],
mlogbInOptions:[], mlogbInOptions:[],
materialOptions: [], materialOptions: [],
mgroup_code:'', mgroup_code:'',
@ -168,6 +241,7 @@ export default {
}; };
}, },
mounted() { mounted() {
this.route_code = this.$route.path.split("/")[2];
this.form.mlog = this.mlog; this.form.mlog = this.mlog;
this.params.mlog = this.mlog; this.params.mlog = this.mlog;
let arr = this.$route.path.split("/"); let arr = this.$route.path.split("/");
@ -176,6 +250,7 @@ export default {
this.getMtask(); this.getMtask();
this.getMaterial(); this.getMaterial();
this.getParentList(); this.getParentList();
this.getEquipment();
}, },
methods: { methods: {
open() { open() {
@ -195,6 +270,17 @@ export default {
that.mlogbIns = res; 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(){ getParentList(){
let that = this; let that = this;
that.$API.wpm.mlogb.list.req(that.params).then((res) => { that.$API.wpm.mlogb.list.req(that.params).then((res) => {