This commit is contained in:
zds
2022-08-04 14:16:27 +08:00
parent f5bc0989f3
commit abf3e919e3
3 changed files with 69 additions and 66 deletions

View File

@@ -18,6 +18,7 @@
输入.workprocedure_code TYPEAS s_string
输入.workprocedure_id TYPEAS s_string
输入.is_active TYPEAS s_string
输入.is_produceuse TYPEAS s_string
[临时表]
@@ -52,9 +53,11 @@
LEFT JOIN sys_dict_detail d ON e.device_attribute_scode = d.value AND name = 'DEVICE_ATTRIBUTE_SCODE'
WHERE
e.is_delete = '0'
OPTION 输入.workprocedure_code <> ""
e.workprocedure_code = 输入.workprocedure_code
ENDOPTION
OPTION 输入.is_produceuse <> ""
e.is_produceuse = 输入.is_produceuse
ENDOPTION
OPTION 输入.workprocedure_id <> ""
e.workprocedure_id = 输入.workprocedure_id

View File

@@ -106,7 +106,7 @@
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation >
<crudOperation>
<el-button
slot="right"
class="filter-item"
@@ -196,7 +196,7 @@
@selection-change="mySelectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="workorder_date" min-width="85" label="日期" :formatter="workorder_dateFormat"/>
<el-table-column prop="workorder_date" min-width="85" label="日期" :formatter="workorder_dateFormat" />
<el-table-column prop="workorder_code" width="130" label="工令号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.workorder_code }}</el-link>
@@ -204,22 +204,22 @@
</el-table-column>
<el-table-column min-width="80" prop="workprocedure_name" label="工序" />
<el-table-column min-width="130" prop="worktask_code" label="工序任务号" />
<el-table-column :formatter="stateFormat" min-width="70" prop="status" label="状态" />
<el-table-column prop="device_name" min-width="100" label="设备"/>
<el-table-column prop="material_code" min-width="130" label="物料编码"/>
<el-table-column :formatter="stateFormat" min-width="70" prop="status" label="状态" />
<el-table-column prop="device_name" min-width="100" label="设备" />
<el-table-column prop="material_code" min-width="130" label="物料编码" />
<el-table-column :formatter="seriesFormat" min-width="80" prop="product_series_id" label="系列" />
<el-table-column prop="pcsn" min-width="80" label="批次"/>
<el-table-column prop="workorder_qty" min-width="80" label="重量" :formatter="crud.formatNum3"/>
<el-table-column prop="product_qty" min-width="100" label="实际生产重量" :formatter="crud.formatNum3"/>
<el-table-column prop="ok_qty" min-width="80" label="合格重量" :formatter="crud.formatNum3"/>
<el-table-column prop="qty_unit_name" min-width="80" label="单位"/>
<el-table-column prop="planstart_time" min-width="140" label="计划开始时间"/>
<el-table-column prop="planend_time" min-width="140" label="计划结束时间"/>
<el-table-column prop="start_time" min-width="140" label="实际开始时间"/>
<el-table-column prop="end_time" min-width="140" label="实际结束时间"/>
<el-table-column prop="start_name" min-width="80" label="开始人"/>
<el-table-column prop="end_name" min-width="80" label="结束人"/>
<el-table-column min-width="100" prop="remark" label="备注" />
<el-table-column prop="pcsn" min-width="80" label="批次" />
<el-table-column prop="workorder_qty" min-width="80" label="重量" :formatter="crud.formatNum3" />
<el-table-column prop="product_qty" min-width="100" label="实际生产重量" :formatter="crud.formatNum3" />
<el-table-column prop="ok_qty" min-width="80" label="合格重量" :formatter="crud.formatNum3" />
<el-table-column prop="qty_unit_name" min-width="80" label="单位" />
<el-table-column prop="planstart_time" min-width="140" label="计划开始时间" />
<el-table-column prop="planend_time" min-width="140" label="计划结束时间" />
<el-table-column prop="start_time" min-width="140" label="实际开始时间" />
<el-table-column prop="end_time" min-width="140" label="实际结束时间" />
<el-table-column prop="start_name" min-width="80" label="开始人" />
<el-table-column prop="end_name" min-width="80" label="结束人" />
<el-table-column min-width="100" prop="remark" label="备注" />
<el-table-column prop="finish_type" label="完成方式" min-width="80" :formatter="finish_typeFormat" />
</el-table>
<!--分页组件-->
@@ -241,12 +241,12 @@ import pagination from '@crud/Pagination'
import DeviceDialog from '@/views/wms/pub/DeviceDialog'
import ViewDialog from '@/views/wms/pdm/produce/workorder/ViewDialog'
import print2Dialog from '@/views/wms/pdm/produce/worktask/print2Dialog'
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute";
import Date from "@/utils/datetime";
import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
import Date from '@/utils/datetime'
export default {
name: 'worktask',
name: 'Worktask',
components: { print2Dialog, ViewDialog, DeviceDialog, crudOperation, rrOperation, udOperation, pagination },
cruds() {
return CRUD({ title: '工令工序任务', idField: 'worktask_id', url: 'api/worktask',
@@ -273,13 +273,13 @@ export default {
print1_flag: true,
print2_flag: true,
mstrow: {},
workProcedureList:[],
workProcedureList: [],
dtlShow: false,
viewShow: false,
printShow: false,
currentRow: null,
checkrows: [],
XLList:[]
XLList: []
}
},
mounted: function() {
@@ -295,7 +295,7 @@ export default {
crudseriesProcessRoute.getXLlist2().then(res => {
this.XLList = res
})
this.crud.query.createTime= [new Date().daysAgo(2), new Date()]
this.crud.query.createTime = [new Date().daysAgo(2), new Date()]
this.crud.toQuery()
},
methods: {
@@ -319,13 +319,13 @@ export default {
this.print1_flag = false
this.print2_flag = false
for (let i = 0; i < rows.length; i++) {
if (rows[i].status !== '10' || rows.length !== 1) {
if (rows[i].status !== '10' || rows.length !== 1) {
this.device_flag = true
}
if (rows[i].status !== '10' || rows[i].device_id==='') {
if (rows[i].status !== '10' || rows[i].device_id === '') {
this.check_flag = true
}
if (rows[i].status !== '20' || rows[i].device_id==='') {
if (rows[i].status !== '20' || rows[i].device_id === '') {
this.begin_flag = true
}
if (rows[i].status !== '30') {
@@ -334,14 +334,14 @@ export default {
if (rows[i].status === '99') {
this.error_flag = true
}
if (rows[i].order_status < '40' || rows.length !== 1) {
if (rows[i].order_status < '40' || rows.length !== 1) {
this.print1_flag = true
}
if (rows.length !== 1 || "GX003,GX004,GX009,GX010,GX011".indexOf(rows[i].workprocedure_code)===-1) {
if (rows.length !== 1 || 'GX003,GX004,GX009,GX010,GX011'.indexOf(rows[i].workprocedure_code) === -1) {
this.print2_flag = true
}
}
}else{
} else {
this.handleCurrentChange()
}
},
@@ -375,14 +375,14 @@ export default {
this.print1_flag = true
this.print2_flag = true
},
deviceset(){
deviceset() {
this.checkrows = this.$refs.table.selection
if(this.checkrows.length !== 1 ){
if (this.checkrows.length !== 1) {
this.crud.notify('只能勾选一条记录!')
return false
}
this.mstrow = this.checkrows.pop()
this.$refs.child.getMsg(this.mstrow.workprocedure_id)
this.$refs.child.getMsg(this.mstrow.workprocedure_id, '1')
this.dtlShow = true
},
tableChanged(row) {
@@ -397,57 +397,56 @@ export default {
},
openWork() {
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
if (this.checkrows.length === 0) {
this.crud.notify('请勾选需要操作的记录!')
return false
}
worktask.openWork({ rows: this.checkrows}).then(res => {
worktask.openWork({ rows: this.checkrows }).then(res => {
this.crud.notify('操作成功!')
this.querytable()
})
},
submit() {
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
if (this.checkrows.length === 0) {
this.crud.notify('请勾选需要操作的记录!')
return false
}
worktask.submit({ 'status': '20', rows: this.checkrows}).then(res => {
worktask.submit({ 'status': '20', rows: this.checkrows }).then(res => {
this.crud.notify('操作成功!')
this.querytable()
})
},
confirmWork() {
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
if (this.checkrows.length === 0) {
this.crud.notify('请勾选需要操作的记录!')
return false
}
worktask.confirmWork({ rows: this.checkrows}).then(res => {
worktask.confirmWork({ rows: this.checkrows }).then(res => {
this.crud.notify('操作成功!')
this.querytable()
})
},
confirmError() {
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
if (this.checkrows.length === 0) {
this.crud.notify('请勾选需要操作的记录!')
return false
}
this.$confirm('是否继续操作?')
.then(_ => {
worktask.confirmError({ rows: this.checkrows}).then(res => {
worktask.confirmError({ rows: this.checkrows }).then(res => {
this.crud.notify('操作成功!')
this.querytable()
})
})
.catch(_ => {
})
},
print1(){
print1() {
this.checkrows = this.$refs.table.selection
if(this.checkrows.length !== 1 ){
if (this.checkrows.length !== 1) {
this.crud.notify('只能勾选一条记录!')
return false
}
@@ -457,9 +456,9 @@ export default {
this.querytable()
})
},
print2(){
print2() {
this.checkrows = this.$refs.table.selection
if(this.checkrows.length !== 1 ){
if (this.checkrows.length !== 1) {
this.crud.notify('只能勾选一条记录!')
return false
}

View File

@@ -19,22 +19,22 @@
prefix-icon="el-icon-search"
class="filter-item"
/> </el-col>
<el-col :span="6" >
<el-select
v-model="query.workprocedure_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
style="width: 200px;"
v-show="disablePro"
>
<el-option
v-for="item in workProcedureList"
:label="item.workprocedure_name"
:value="item.workprocedure_id"
/>
</el-select>
<el-col :span="6">
<el-select
v-show="disablePro"
v-model="query.workprocedure_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
style="width: 200px;"
>
<el-option
v-for="item in workProcedureList"
:label="item.workprocedure_name"
:value="item.workprocedure_id"
/>
</el-select>
</el-col>
<el-col :span="6">
<rrOperation />
@@ -79,7 +79,7 @@ import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudDeviceinfo from '@/api/wms/basedata/em/deviceinfo'
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
export default {
name: 'DeviceDialog',
@@ -91,7 +91,7 @@ export default {
url: 'api/deviceinfo',
idField: 'device_id',
sort: '',
query: { device_code: '', workprocedure_id: '' }
query: { device_code: '', workprocedure_id: '', is_produceuse: '' }
})
},
dicts: ['IS_OR_NOT'],
@@ -132,9 +132,10 @@ export default {
* 接受父组件传值
* @param msg
*/
getMsg(msg) {
getMsg(msg, msg2) {
this.disablePro = false
this.crud.query.workprocedure_id = msg
this.crud.query.is_produceuse = msg2
this.crud.toQuery()
},
formatProduceuserName(row, column) {