更新
This commit is contained in:
@@ -177,7 +177,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, {crud, header, presenter} from '@crud/crud'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
|
||||
import crudProduceshiftorder from '@/api/wms/mps/produceshiftorder'
|
||||
|
||||
183
mes/qd/src/views/wms/mps/produce/ReplaceDeviceDialog.vue
Normal file
183
mes/qd/src/views/wms/mps/produce/ReplaceDeviceDialog.vue
Normal file
@@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="更换设备"
|
||||
append-to-body
|
||||
width="380px"
|
||||
:visible.sync="dialogVisible"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini">
|
||||
<el-form-item label="所属工序" prop="workprocedure_id">
|
||||
<el-select
|
||||
v-model="form.workprocedure_id"
|
||||
disabled
|
||||
clearable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workprocedureList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单编号" prop="produceorder_code">
|
||||
<el-input v-model="form.produceorder_code" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="device_code">
|
||||
<el-input v-model="form.device_code" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="device_id">
|
||||
<el-select
|
||||
v-model="form.device_id"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
@change="putDeviceCode()"
|
||||
@clear="form.device_code = ''"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.device_id"
|
||||
:label="item.device_name"
|
||||
:value="item.device_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="replaceDevice">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
|
||||
import crudProduceshiftorder from '@/api/wms/mps/produceshiftorder'
|
||||
import crudDevice from '@/api/wms/pdm/device'
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
components: { },
|
||||
dicts: [],
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
workprocedureList: [],
|
||||
deviceList: [],
|
||||
form: {
|
||||
workprocedure_id: '',
|
||||
device_id: '',
|
||||
device_code: '',
|
||||
produceorder_code: ''
|
||||
},
|
||||
rules: {
|
||||
device_id: [
|
||||
{ required: true, message: '设备名称不为空', trigger: 'blur' }
|
||||
],
|
||||
produceorder_code: [
|
||||
{ required: true, message: '工单编号不为空', trigger: 'blur' }
|
||||
],
|
||||
workprocedure_id: [
|
||||
{ required: true, message: '所属工序不为空', trigger: 'blur' }
|
||||
],
|
||||
device_code: [
|
||||
{ required: true, message: '设备编码不为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询工序
|
||||
this.getworkprocedure()
|
||||
this.getNotWorkDeviceByWorkproceduceId(this.form.workprocedure_id)
|
||||
},
|
||||
putDeviceCode() {
|
||||
if (this.form.device_id !== '' && this.form.device_id !== undefined) {
|
||||
crudDevice.queryById(this.form.device_id).then(res => {
|
||||
this.form.device_code = res.device_code
|
||||
})
|
||||
}
|
||||
},
|
||||
replaceDevice() {
|
||||
if (this.form.device_id === '' || this.form.device_id === null || this.form.device_id === undefined){
|
||||
this.crud.notify('设备名称不能为空', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
return
|
||||
}
|
||||
crudProduceshiftorder.replaceDevice(this.form).then(res => {
|
||||
this.crud.notify('更换成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.dialogVisible = false
|
||||
this.$emit('AddChanged')
|
||||
})
|
||||
},
|
||||
getNotWorkDeviceByWorkproceduceId(workproceduce_id) {
|
||||
crudProduceshiftorder.getNotWorkDeviceByWorkproceduceId({ workproceduce_id: workproceduce_id }).then(res => {
|
||||
this.deviceList = res
|
||||
})
|
||||
},
|
||||
getworkprocedure() {
|
||||
// 查询工序
|
||||
crudWorkProcedure.downSelect({}).then(res => {
|
||||
this.workprocedureList = res
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
setForm(workprocedure_id, produceorder_code) {
|
||||
this.form.device_id = ''
|
||||
this.form.device_code = ''
|
||||
this.form.workprocedure_id = workprocedure_id
|
||||
this.form.produceorder_code = produceorder_code
|
||||
this.dialogVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
116
mes/qd/src/views/wms/mps/produce/UploadDialog.vue
Normal file
116
mes/qd/src/views/wms/mps/produce/UploadDialog.vue
Normal file
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudProduceshiftorder from '@/api/wms/mps/produceshiftorder'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
crudProduceshiftorder.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -62,35 +62,6 @@
|
||||
<!--分页组件-->
|
||||
|
||||
</div>
|
||||
<el-dialog
|
||||
title="请绑定设备"
|
||||
:visible.sync="devicedialogVisible"
|
||||
width="350px"
|
||||
:before-close="handleClose">
|
||||
<el-form :model="deviceForm" status-icon label-width="90px" ref="deviceForm" class="demo-ruleForm">
|
||||
<el-form-item label="选择设备" prop="device_id">
|
||||
<el-select
|
||||
v-model="deviceForm.device_id"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.device_id"
|
||||
:label="item.device_name"
|
||||
:value="item.device_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="saveDevice">保存</el-button>
|
||||
<el-button @click="devicedialogVisible = false">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="报工数量"
|
||||
:visible.sync="reportdialogVisibler"
|
||||
@@ -132,14 +103,11 @@ export default {
|
||||
dicts: ['PDM_BI_SHIFTTYPE', 'MPS_BD_ORDERSTATUS', 'is_used', 'PDM_BI_ORDERTYPE'],
|
||||
data() {
|
||||
return {
|
||||
devicedialogVisible: false,
|
||||
reportdialogVisibler: false,
|
||||
deviceForm: { device_id: null },
|
||||
reportForm: { report_qty: null, produce_qty: null, init_qty: null, finish_qty: null, finishproduct_qty: null },
|
||||
currentDate: new Date(),
|
||||
getTime: '',
|
||||
getDate: '',
|
||||
deviceList: [],
|
||||
choice: '',
|
||||
is_openStart: true,
|
||||
is_reportWork: true,
|
||||
@@ -246,7 +214,6 @@ export default {
|
||||
this.notify('刷新成功', 'success')
|
||||
},
|
||||
handleClose() {
|
||||
this.devicedialogVisible = false
|
||||
this.reportdialogVisibler = false
|
||||
},
|
||||
getTable() {
|
||||
@@ -254,13 +221,6 @@ export default {
|
||||
this.tableData = res
|
||||
})
|
||||
},
|
||||
openStart() {
|
||||
crudProduceshiftorder.getDevice({ workprocedure_id: this.choice.workprocedure_id }).then(res => {
|
||||
this.deviceList = res
|
||||
})
|
||||
this.devicedialogVisible = true
|
||||
this.deviceForm.device_id = this.choice.device_id
|
||||
},
|
||||
reportWork() {
|
||||
this.reportdialogVisibler = true
|
||||
this.getReportWork(this.choice.produceorder_id)
|
||||
@@ -286,15 +246,10 @@ export default {
|
||||
this.isDisabled()
|
||||
})
|
||||
},
|
||||
saveDevice() {
|
||||
if (this.deviceForm.device_id === '' || this.deviceForm.device_id === null || this.deviceForm.device_id === undefined) {
|
||||
this.notify('请选择要绑定的设备', 'info')
|
||||
return
|
||||
}
|
||||
crudProduceshiftorder.openStart({ device_id: this.deviceForm.device_id, row: this.choice }).then(res => {
|
||||
openStart() {
|
||||
crudProduceshiftorder.openStart({ row: this.choice }).then(res => {
|
||||
this.notify('操作成功', 'success')
|
||||
this.getTable()
|
||||
this.devicedialogVisible = false
|
||||
this.isDisabled()
|
||||
})
|
||||
},
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
type="info"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@@ -135,7 +135,7 @@
|
||||
>
|
||||
复制新增
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
@@ -144,6 +144,16 @@
|
||||
@click="add"
|
||||
>
|
||||
批量新增
|
||||
</el-button>-->
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
@@ -303,6 +313,22 @@
|
||||
<el-form-item label="工单数量" prop="orderNum">
|
||||
<el-input v-model="form.orderNum" type="number" :min="1" oninput="value = value.replace(/[^\d]/g, '')" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人员" prop="jockey_id">
|
||||
<el-select
|
||||
v-model="form.jockey_id"
|
||||
clearable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.id"
|
||||
:label="item.nickName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
@@ -350,7 +376,7 @@
|
||||
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="sale_id" label="销售单标识" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="class_name" label="产品系列" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_weight" label="物料单重" :formatter="rounding" />
|
||||
<el-table-column prop="material_weight" label="物料单重" />
|
||||
<el-table-column prop="planproducestart_date" label="计划生产开始时间" width="150" />
|
||||
<el-table-column prop="planproduceend_date" label="计划生产结束时间" width="150" />
|
||||
<el-table-column prop="realproducestart_date" label="实际生产开始时间" width="150" />
|
||||
@@ -375,6 +401,9 @@
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
<el-button slot="right" :disabled="scope.row.order_status === '04' || scope.row.order_status === '02'" size="mini" type="text" icon="el-icon-warning" @click="replaceDevice(scope.row.workprocedure_id, scope.row.produceorder_code)">
|
||||
更换设备
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -388,7 +417,9 @@
|
||||
@setMaterValue="setMaterValue"
|
||||
/>
|
||||
<ViewDialog ref="child3" />
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="tableChanged3" />
|
||||
<AddDialog :dialog-show.sync="addShow" @AddChanged="querytable" />
|
||||
<ReplaceDeviceDialog ref="child4" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -406,6 +437,8 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import ViewDialog from '@/views/wms/mps/produce/ViewDialog'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import AddDialog from '@/views/wms/mps/produce/AddDialog'
|
||||
import UploadDialog from '@/views/wms/mps/produce/UploadDialog'
|
||||
import ReplaceDeviceDialog from '@/views/wms/mps/produce/ReplaceDeviceDialog'
|
||||
|
||||
const defaultForm = {
|
||||
produceorder_id: null,
|
||||
@@ -441,11 +474,12 @@ const defaultForm = {
|
||||
is_canupdate_update: '1',
|
||||
material_spec: null,
|
||||
sale_id: null,
|
||||
orderNum: 1
|
||||
orderNum: 1,
|
||||
jockey_id: ''
|
||||
}
|
||||
export default {
|
||||
name: 'Produceshiftorder',
|
||||
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation, MaterDtl, Treeselect, ViewDialog },
|
||||
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation, MaterDtl, Treeselect, ViewDialog, UploadDialog, ReplaceDeviceDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['PDM_BI_SHIFTTYPE', 'MPS_BD_ORDERSTATUS', 'is_used', 'PDM_BI_ORDERTYPE', 'IS_OR_NOT'],
|
||||
cruds() {
|
||||
@@ -470,13 +504,19 @@ export default {
|
||||
materType: '01',
|
||||
materialShow: false,
|
||||
addShow: false,
|
||||
replaceShow: false,
|
||||
uploadShow: false,
|
||||
workprocedureList: [],
|
||||
userList: [],
|
||||
order_status: ['-1'],
|
||||
permission: {},
|
||||
rules: {
|
||||
produceorder_code: [
|
||||
{ required: true, message: '生产班次工单编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
jockey_id: [
|
||||
{ required: true, message: '操作人员不能为空', trigger: 'blur' }
|
||||
],
|
||||
producedeviceorder_code: [
|
||||
{ required: true, message: '机台工单号不能为空', trigger: 'blur' }
|
||||
],
|
||||
@@ -516,8 +556,17 @@ export default {
|
||||
created() {
|
||||
this.getworkprocedure()
|
||||
this.initClass3()
|
||||
this.getUser()
|
||||
},
|
||||
methods: {
|
||||
tableChanged3() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
getUser() {
|
||||
crudProduceshiftorder.getUser().then(res => {
|
||||
this.userList = res
|
||||
})
|
||||
},
|
||||
initDataPlan() {
|
||||
const date = this.dateFormatter(new Date())
|
||||
const formatter1 = this.dateFormatter1(new Date())
|
||||
@@ -652,13 +701,13 @@ export default {
|
||||
if (length > 1) {
|
||||
var flag = false
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
if (rows[i].order_status !== '00') {
|
||||
if (rows[i].order_status !== '00' || rows[i].device_id === '') {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
return flag
|
||||
} else if (length === 1 && rows[0].order_status === '00') {
|
||||
} else if (length === 1 && rows[0].order_status === '00' && rows[0].device_id !== '') {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
@@ -713,6 +762,9 @@ export default {
|
||||
add() {
|
||||
this.addShow = true
|
||||
},
|
||||
replaceDevice(workProcedure_id, order_code) {
|
||||
this.$refs.child4.setForm(workProcedure_id, order_code)
|
||||
},
|
||||
copyAdd(data) {
|
||||
this.crud.toCopy(data)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user