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_code TYPEAS s_string
输入.workprocedure_id TYPEAS s_string 输入.workprocedure_id TYPEAS s_string
输入.is_active 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' LEFT JOIN sys_dict_detail d ON e.device_attribute_scode = d.value AND name = 'DEVICE_ATTRIBUTE_SCODE'
WHERE WHERE
e.is_delete = '0' e.is_delete = '0'
OPTION 输入.workprocedure_code <> "" OPTION 输入.workprocedure_code <> ""
e.workprocedure_code = 输入.workprocedure_code e.workprocedure_code = 输入.workprocedure_code
ENDOPTION
OPTION 输入.is_produceuse <> ""
e.is_produceuse = 输入.is_produceuse
ENDOPTION ENDOPTION
OPTION 输入.workprocedure_id <> "" OPTION 输入.workprocedure_id <> ""
e.workprocedure_id = 输入.workprocedure_id e.workprocedure_id = 输入.workprocedure_id

View File

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

View File

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