代码更新

This commit is contained in:
2022-09-26 15:04:26 +08:00
parent adddfa1c80
commit 1d9e96a25f
13 changed files with 230 additions and 51 deletions

View File

@@ -8,12 +8,13 @@
destroy-on-close
@close="close"
>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<el-row :gutter="24">
<el-col :span="18" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<el-col :span="6">
<span>
<el-button icon="el-icon-check" size="mini" type="primary" @click="submitAndEnd">保存并结束</el-button>
<el-button icon="el-icon-check" size="mini" type="primary" @click="submitMain">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
</span>
@@ -183,6 +184,17 @@ export default {
this.crud.toQuery()
this.dialogVisible = false
})
},
submitAndEnd() {
const data = this.form
if (this.form.update_optname === '') {
return this.crud.notify('保养人不能为空', CRUD.NOTIFICATION_TYPE.INFO)
}
crudDevicemaintenancemst.endMaintain(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.dialogVisible = false
this.crud.toQuery()
})
}
}
}

View File

@@ -0,0 +1,111 @@
<template>
<el-dialog
title="开始维修"
append-to-body
:visible.sync="dialogVisible"
:before-close="handleClose"
width="550px"
destroy-on-close
@close="close"
>
<el-form ref="form" :inline="true" :model="form4" size="mini" label-width="120px" label-suffix=":">
<el-row>
<el-col :span="24">
<el-form-item label="维修人" prop="update_optname">
<el-input v-model="form4.update_optname" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button icon="el-icon-check" size="mini" type="primary" @click="submitResuft">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudDevicemaintenancemst from '@/api/wms/sb/devicemaintenancemst'
export default {
name: 'StartDialog',
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
this.form4 = this.openParam
}
}
},
data() {
return {
form4: {
},
dialogVisible: false
}
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {
})
},
close() {
this.$emit('update:dialogShow', false)
},
submitResuft() {
if (!this.form4.update_optname) {
return this.crud.notify('保养人不能为空', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = this.form4
crudDevicemaintenancemst.startMaintain(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.dialogVisible = false
this.crud.toQuery()
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -89,7 +89,7 @@
>
开始保养
</el-button>
<el-button
<!-- <el-button
slot="right"
class="filter-item"
type="success"
@@ -99,7 +99,7 @@
@click="executeMaintain"
>
保养执行
</el-button>
</el-button>-->
<el-button
slot="right"
class="filter-item"
@@ -120,7 +120,7 @@
:disabled="confirm_flag"
@click="confirmMaintain"
>
保养确认
保养验收
</el-button>
</crudOperation>
<!--表格渲染-->
@@ -150,6 +150,7 @@
<pagination />
</div>
<ExecuteDialog :dialog-show.sync="executeDialog" :open-param="openParam" />
<StartDialog :dialog-show.sync="startDialog" :open-param="openParam" />
</div>
</template>
@@ -166,11 +167,12 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
import DateRangePicker from '@/components/DateRangePicker'
import ExecuteDialog from '@/views/wms/sb/upkeep/devicemaintenancepa/ExecuteDialog'
import StartDialog from '@/views/wms/sb/upkeep/devicemaintenancepa/StartDialog'
export default {
name: 'Devicemaintenancepa',
dicts: ['EM_DEVICE_BY_INVSTATUS', 'EM_DEVICE_BY_INVTYPE'],
components: { ExecuteDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect, DateRangePicker },
components: { ExecuteDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect, DateRangePicker, StartDialog },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
@@ -199,6 +201,7 @@ export default {
materOpt_code: '23',
openParam: null,
executeDialog: false,
startDialog: false,
permission: {
}
}
@@ -262,10 +265,8 @@ export default {
if (data.invstatus !== '02') {
return this.crud.notify('只能对提交状态的单据开始', CRUD.NOTIFICATION_TYPE.INFO)
}
crudDevicemaintenancemst.startMaintain(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
this.openParam = data
this.startDialog = true
},
endMaintain() {
const _selectData = this.$refs.table.selection
@@ -273,10 +274,17 @@ export default {
if (data.invstatus !== '03') {
return this.crud.notify('只能对开始状态的单据结束', CRUD.NOTIFICATION_TYPE.INFO)
}
crudDevicemaintenancemst.endMaintain(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
crudDevicemaintenancemst.getDtl(data).then(res => {
this.openParam = {
'form': data,
'tableData': res
}
this.executeDialog = true
})
// crudDevicemaintenancemst.endMaintain(data).then(res => {
// this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
// this.crud.toQuery()
// })
},
executeMaintain() {
const _selectData = this.$refs.table.selection