6 changed files with 717 additions and 32 deletions
-
4src/api/production/generateReport.js
-
676src/views/modules/production/cancelSfdc.vue
-
20src/views/modules/production/print_seqNo_label.js
-
22src/views/modules/production/print_stock_label.js
-
20src/views/modules/production/print_transNo_label.js
-
7src/views/modules/taskmanage/taskReport.vue
@ -0,0 +1,676 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'生产订单号'"> |
|||
<el-input v-model="searchData.orderNo" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'加工中心编码'"> |
|||
<el-input v-model="searchData.workCenterNo" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(5)"><a herf="#">产品编码</a></span> |
|||
<el-input v-model="searchData.partNo" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'工序编号'"> |
|||
<el-input v-model="searchData.itemNo" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'加工中心编号'"> |
|||
<el-input v-model="searchData.workCenterNo" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|||
<el-form-item :label="'报工日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.startDate" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item :label="'至: '"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.endDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(26)"><a herf="#">操作员姓名</a></span> |
|||
<el-input v-model="searchData.operatorName" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台ID</a></span> |
|||
<el-input v-model="searchData.resourceId" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'班次'"> |
|||
<el-select v-model="searchData.shiftNo" style="width: 120px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="白班" value="白班"></el-option> |
|||
<el-option label="晚班" value="晚班"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-button @click="search()" style="margin-left: 0px;margin-top:0px" type="primary">查询</el-button> |
|||
<download-excel |
|||
:fields="fields()" |
|||
type="xls" |
|||
:name="exportName" |
|||
:fetch="createExportData" |
|||
worksheet="导出信息" |
|||
class="el-button el-button--primary el-button--medium"> |
|||
{{ '导出' }} |
|||
</download-excel> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:height="height" |
|||
:data="tableData" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
fixed="left" |
|||
align="center" |
|||
width="80" |
|||
label="操作"> |
|||
<template slot-scope="scope" class="foo_container"> |
|||
<a type="text" size="small" v-if="scope.row.reverseflag==='N'" @click="cancelSfdc(scope.row)">取消报工</a> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
header-align="center" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|||
style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-dialog title="操作员明细" :close-on-click-modal="false" v-drag :visible.sync="operatorModalFlag" width="450px"> |
|||
<el-table |
|||
height="200" |
|||
:data="operatorModalList" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
type="index" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="60" |
|||
label="序号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="operatorID" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="操作员ID"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="operatorName" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="120" |
|||
label="操作员姓名"> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="operatorModalFlag = false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
<el-dialog title="不良原因" :close-on-click-modal="false" v-drag :visible.sync="defectModalFlag" width="450px"> |
|||
<el-table |
|||
height="200" |
|||
:data="defectModalList" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
type="index" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="60" |
|||
label="序号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="defectCode" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="不良代码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="defectDesc" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="120" |
|||
label="不良原因"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="defectQty" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="120" |
|||
label="不良数量"> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="defectModalFlag = false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
<!-- 动态列 --> |
|||
<column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column> |
|||
|
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getSfdcList, |
|||
cancelSfdc, |
|||
|
|||
} from '@/api/production/generateReport.js' |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
import { |
|||
saveTableDefaultList, |
|||
getTableDefaultListLanguage, |
|||
getTableUserListLanguage, |
|||
removerDefault, |
|||
removerUser |
|||
} from "@/api/table.js" |
|||
import column from "../common/column"; |
|||
// import { |
|||
// printSeqNoLabel, |
|||
// } from "@/views/modules/production/print_seqNo_label.js" |
|||
|
|||
export default { |
|||
name: 'searchSOScheduleRouting', |
|||
components: { |
|||
Chooselist,column |
|||
}, |
|||
data () { |
|||
return { |
|||
site: this.$store.state.user.site, |
|||
// 导出+动态列 start |
|||
exportData: [], |
|||
userDev:this.$store.state.user.userDev, |
|||
exportName: "派工单列表"+this.getStrDate(), |
|||
columnList: [ |
|||
{ |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "site", |
|||
columnLabel: "工厂编号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 60, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "assJobSeqNo", |
|||
columnLabel: "派工单号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 80, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'right' |
|||
}, |
|||
{ |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "orderNo", |
|||
columnLabel: "生产订单号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 80, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "itemNo", |
|||
columnLabel: "工序号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 60, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'right' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "operationDesc", |
|||
columnLabel: "工序名称", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 120, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "seqNo", |
|||
columnLabel: "次序号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 50, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'right' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "partNo", |
|||
columnLabel: "物料编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 70, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "workCenterNo", |
|||
columnLabel: "加工中心编号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 70, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "reportDate", |
|||
columnLabel: "报工时间", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 130, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "operatorId", |
|||
columnLabel: "操作员", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 70, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "operatorName", |
|||
columnLabel: "操作员姓名", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 100, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "reverseflag", |
|||
columnLabel: "是否已取消报工", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 80, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "reportQty", |
|||
columnLabel: "报告数量", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 80, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'right' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "approveQty", |
|||
columnLabel: "合格数量", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 80, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'right' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "reportedManfTime", |
|||
columnLabel: "生产时间", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 70, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'right' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "shiftNo", |
|||
columnLabel: "班次编号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 70, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "resourceId", |
|||
columnLabel: "机台编号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 70, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
}, { |
|||
tableId: "sfdcList", |
|||
tableName: this.$route.meta.title, |
|||
columnProp: "resourceDesc", |
|||
columnLabel: "机台名称", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 100, |
|||
format: null, |
|||
functionId: this.$route.meta.menuId, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
serialNumber: null, |
|||
columnType: null, |
|||
align: 'left' |
|||
} |
|||
], |
|||
visible:false, |
|||
queryTable: { |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.$route.meta.menuId, |
|||
tableId: "sfdcList", |
|||
languageCode: this.$i18n.locale |
|||
}, |
|||
// 导出 end |
|||
height: 200, |
|||
tableData: [], |
|||
searchData: { |
|||
orderNo: '', |
|||
workCenterNo: '', |
|||
partNo: '', |
|||
site: this.$store.state.user.site, |
|||
itemNo:'', |
|||
startDate:new Date(), |
|||
endDate:'', |
|||
operatorName:'', |
|||
resourceId:'', |
|||
shiftNo:'', |
|||
}, |
|||
operatorModalList:[], |
|||
operatorModalFlag:false, |
|||
defectModalList:[], |
|||
defectModalFlag:false, |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 210 |
|||
this.height2 = window.innerHeight -100 |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 24) { |
|||
strVal = this.searchData.workCenterNo |
|||
} |
|||
if (val === 5) { |
|||
strVal = this.searchData.partNo |
|||
} |
|||
if (val === 26) { |
|||
strVal = this.searchData.operatorName |
|||
} |
|||
if (val === 88) { |
|||
strVal = this.searchData.resourceId |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 24) { |
|||
this.searchData.workCenterNo = val.WorkCenterNo |
|||
} else if (this.tagNo === 5) { |
|||
this.searchData.partNo = val.PartNo |
|||
} |
|||
if (this.tagNo === 26) { |
|||
this.searchData.operatorName = val.OperatorName |
|||
} |
|||
if (this.tagNo === 88) { |
|||
this.searchData.resourceId = val.ResourceID |
|||
} |
|||
}, |
|||
|
|||
search () { |
|||
getSfdcList(this.searchData).then(({data}) => { |
|||
this.tableData = data.rows |
|||
}) |
|||
}, |
|||
cancelSfdc(row){ |
|||
this.$confirm(`确定取消此报工记录`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
cancelSfdc(row).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.search (); |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => { |
|||
} |
|||
}) |
|||
}else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
// 导出+动态列 |
|||
fields() { |
|||
let json = "{" |
|||
this.columnList.forEach((item, index) => { |
|||
if (index == this.columnList.length - 1) { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|||
} else { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|||
} |
|||
}) |
|||
json += "}" |
|||
let s = eval("(" + json + ")") |
|||
return s |
|||
}, |
|||
createExportData() { |
|||
// 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据 |
|||
return this.tableData; |
|||
}, |
|||
getStrDate() { |
|||
let dd = new Date(); |
|||
let Y = dd.getFullYear(); |
|||
let M = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);//获取当前月份的日期,不足10补0 |
|||
let D = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//获取当前几号,不足10补0 |
|||
let H = dd.getHours() < 10 ? "0" + dd.getHours() : dd.getHours(); |
|||
let MM = dd.getMinutes() < 10 ? "0" + dd.getMinutes() : dd.getMinutes(); |
|||
let S = dd.getSeconds() < 10 ? "0" + dd.getSeconds() : dd.getSeconds(); |
|||
return Y + M + D + H + MM + S; |
|||
|
|||
}, |
|||
userSetting() { |
|||
this.visible = true; |
|||
this.$nextTick(() => { |
|||
this.$refs.column.init(this.queryTable); |
|||
}); |
|||
}, |
|||
|
|||
}, |
|||
created () { |
|||
// this.getTableUserColumn() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.input_left{ |
|||
text-align: left; |
|||
} |
|||
.input_reight{ |
|||
text-align: right; |
|||
} |
|||
/deep/ input::-webkit-inner-spin-button { |
|||
-webkit-appearance: none !important; |
|||
} |
|||
input[type='number'] { |
|||
-moz-appearance: textfield !important; |
|||
} |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue