ruanqi 3 years ago
parent
commit
fafeb39839
  1. 7
      src/api/production/schedule.js
  2. 0
      src/views/modules/print/label/print_seqNo_label.js
  3. 146
      src/views/modules/print/label/print_stock_label_preview.js
  4. 245
      src/views/modules/print/stockPrint.vue
  5. 615
      src/views/modules/schedule/cancelSfdc.vue
  6. 2
      src/views/modules/schedule/closeSchedule.vue
  7. 791
      src/views/modules/schedule/generateReport.vue
  8. 579
      src/views/modules/schedule/searchSfdc.vue
  9. 2
      src/views/modules/schedule/soscheduleRouting.vue

7
src/api/production/schedule.js

@ -9,4 +9,11 @@ export const getSOScheduleRoutingData=data => createAPI(`schedule/getSOScheduleR
export const cancelJob=data => createAPI(`schedule/cancelJob`, 'post', data);
export const circulationSchedule=data => createAPI(`schedule/circulationSchedule`, 'post', data);
export const closeSchedule=data => createAPI(`schedule/closeSchedule`, 'post', data);
export const saveGenerateReportForSchedule=data => createAPI(`schedule/saveGenerateReportForSchedule`, 'post', data);
export const searchReportedQty=data => createAPI(`schedule/searchReportedQty`, 'post', data);
export const searchSeqNo=data => createAPI(`schedule/searchSeqNo`, 'post', data);
export const startSeqNo=data => createAPI(`schedule/startSeqNo`, 'post', data);
export const getSfdcList=data => createAPI(`schedule/getSfdcList`, 'post', data);
export const cancelSfdc=data => createAPI(`schedule/cancelSfdc`, 'post', data);
export const getStockPrint=data => createAPI(`schedule/getStockPrint`, 'post', data);

0
src/views/modules/print/print_seqNo_label.js → src/views/modules/print/label/print_seqNo_label.js

146
src/views/modules/print/label/print_stock_label_preview.js

@ -0,0 +1,146 @@
/*调用js打印标签*/
import getLodop from '@/utils/LodopFuncs.js'
/*打印材料卷标签*/
export function printMaterialLabelPreview(printList) {
const LODOP = getLodop()
if (LODOP) {
//LODOP.SET_LICENSES("", "AF8A5800B84BCC5218BCF67B92627BEA", "", "");
LODOP.SET_LICENSES("", "AF8A5800B823CC8E18BCF67B925E7BF0", "", "");
// LODOP.SET_PRINTER_INDEXA("小标签打印机");
//循环调用打印机
for(let i = 0; i < printList.length; i++){
let printData = printList[i];
LODOP.NewPage();
LODOP.SET_PRINT_PAGESIZE(0,1000,700,"");
LODOP.ADD_PRINT_BARCODE(43,244,208,140,"QRCode",printData.seqNo);
LODOP.ADD_PRINT_TEXT(112,8,133,25,"WareHouse ID:");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(112,110,140,25,printData.wareHouseDesc);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(154,8,103,24,"Batch No:");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(154,110,140,20,printData.batchNo);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(133,8,124,25,"Location ID:");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(133,110,139,25,printData.locationId);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(41,8,132,25,"Part:");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(41,56,195,55,printData.partNo+'|'+printData.partDesc);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(175,8,82,25,"Order No:");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(175,110,141,25,printData.orderNo);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(91,8,81,25,"Q.T.Y:");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(91,87,138,24,printData.qty+printData.umid);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(194,8,113,25,"Trans Date:");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(194,110,244,25,printData.transDate);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(224,5,256,24,"Manufactured by A&M Polymer");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.ADD_PRINT_TEXT(224,212,156,25,"IATF:16949 Certified");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
LODOP.ADD_PRINT_LINE(218,2,217,374,0,1);
LODOP.ADD_PRINT_TEXT(9,140,100,30,"库存标签");
LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(194,266,110,25,"工厂编码:"+printData.site);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(176,216,100,20,"Valid Date:");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(176,296,100,25,printData.expiredDate);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(29,209,189,25,printData.status);
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
if(printData.weight!=''&&printData.weight!=0) {
LODOP.ADD_PRINT_TEXT(92,154,100,25,'/'+printData.weight+'KG');
LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
}
}
// LODOP.PRINT_DESIGN();
LODOP.PREVIEW();
// LODOP.PRINT();
console.log("操作成功!")
}
}
// LODOP.SET_PRINT_PAGESIZE(0,1000,700,"");
// LODOP.ADD_PRINT_BARCODE(11,244,208,140,"QRCode",printData.seqNo);
// LODOP.ADD_PRINT_TEXT(58,8,108,25,"WareHouseId:");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(58,110,140,25,printData.wareHouseId);
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(111,8,77,24,"BatchNo:");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(111,110,140,20,printData.batchNo);
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(84,8,98,25,"LocationId:");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(84,110,139,25,printData.locationId);
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(9,8,72,25,"PartNo:");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(9,110,136,25,printData.partNo);
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(136,8,82,25,"OrderNo:");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(136,110,141,25,printData.orderNo);
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(34,8,56,25,"Qty:");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(34,110,138,24,printData.qty);
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(162,8,92,25,"TransDate:");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(162,110,170,25,printData.transDate);
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
// LODOP.ADD_PRINT_TEXT(192,5,256,24,"Manufactured by A&M Polymer");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.ADD_PRINT_TEXT(192,259,109,25,"vender Code:");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.ADD_PRINT_TEXT(210,5,257,35,"No.188 Taigu Road,Lili lndustrial Park,Wujiang District,Suzhou,China");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.ADD_PRINT_TEXT(246,5,407,35,"Phone: 086-0512-63678826 Email: service@husenrubber.com");
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
// LODOP.ADD_PRINT_LINE(186,2,187,374,0,1);

245
src/views/modules/print/stockPrint.vue

@ -0,0 +1,245 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" >
<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.batchNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'是否显示库存为0的批次:'">
<el-select v-model="searchData.zeroSql" style="width: 120px">
<el-option label="是" value=" "></el-option>
<el-option label="否" value=" AND QtyOnHand >0.0001"></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>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="tableData"
border
style="width: 100%">
<el-table-column
prop=""
header-align="center"
align="center"
min-width="60"
label="操作">
<template slot-scope="scope" class="foo_container">
<a type="text" size="small" @click="printStock(scope.row)">打印标签</a>
</template>
</el-table-column>
<el-table-column
prop="site"
header-align="center"
align="left"
min-width="70"
label="工厂编码">
</el-table-column>
<el-table-column
prop="partNo"
header-align="center"
align="left"
min-width="100"
label="物料编码">
</el-table-column>
<el-table-column
prop="partDesc"
header-align="center"
align="left"
min-width="200"
label="物料名称">
</el-table-column>
<el-table-column
prop="qtyOnHand"
header-align="center"
align="right"
min-width="80"
label="当前库存">
</el-table-column>
<el-table-column
prop="warehouseID"
header-align="center"
align="left"
min-width="80"
label="仓库编码">
</el-table-column>
<el-table-column
prop="locationID"
header-align="center"
align="left"
min-width="80"
label="库位Id">
</el-table-column>
<el-table-column
prop="batchNo"
header-align="center"
align="left"
min-width="110"
label="批号">
</el-table-column>
<el-table-column
prop="manufactureDate"
header-align="center"
align="left"
min-width="130"
label="生产日期">
</el-table-column>
<el-table-column
prop="expiredDate"
header-align="center"
align="left"
min-width="130"
label="失效日期">
</el-table-column>
</el-table>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getStockPrint
} from "@/api/production/schedule.js"
import Chooselist from '@/views/modules/common/Chooselist'
import {
printMaterialLabelPreview,
} from "@/views/modules/print/label/print_stock_label_preview.js"
export default {
name: 'soscheduleRouting',
components: {
Chooselist
},
data () {
return {
site: this.$store.state.user.site,
operatorType: 0,
height: 200,
tableData: [],
date1: '',
searchData: {
partNo: '',
zeroSql:' AND QtyOnHand >0.0001',
batchNo:'',
},
photoUrl:'',
sopData:{
site:'',
partNo:'',
},
partDescription:'',
fileTitle:'',
fileName:'',
num:1,
currentData:'',
photoDatas:[],
uploadImg:[],
showviewer: false,
url: '',
height2:600,
}
},
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 === 5) {
strVal = this.searchData.partNo
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 5) {
this.searchData.partNo = val.PartNo
}
},
search () {
if(this.searchData.partNo==''&&this.searchData.batchNo==''){
this.$alert('料号和批次,请至少输入一个条件!', '错误', {
confirmButtonText: '确定'
})
return false;
}
getStockPrint(this.searchData).then(({data}) => {
this.tableData = data.rows
})
},
createExportData () {
return this.tableData
},
startDownload () {
// this.exportData = this.dataList
},
finishDownload () {
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
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
},
printStock(row){
let array=[];
let data={
seqNo:row.site+'|'+row.partNo+'|'+row.wareHouseId+'|'+row.batchNo+'|'+row.locationId,
site:row.site,
wareHouseId:row.wareHouseId,
batchNo:row.batchNo,
locationId:row.locationId,
partNo:row.partNo,
partDesc:row.partDesc,
wareHouseDesc:row.wareHouseDesc,
orderNo:row.orderNo,
transDate:row.transDate,
expiredDate:row.expiredDate,
}
array.push(data)
printMaterialLabelPreview(array);
},
},
created () {
}
}
</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>

615
src/views/modules/schedule/cancelSfdc.vue

@ -0,0 +1,615 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'派工单号'">
<el-input v-model="searchData.seqNo" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" style="width: 130px"></el-input>
</el-form-item>
<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: 120px"></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>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getSfdcList,
cancelSfdc,
} from "@/api/production/schedule.js"
import Chooselist from '@/views/modules/common/Chooselist'
export default {
name: 'cancelSfdc',
components: {
Chooselist
},
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: "partDesc",
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: "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: 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: "statisticDate",
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,
// end
height: 200,
tableData: [],
searchData: {
seqNo:'',
orderNo: '',
workCenterNo: '',
partNo: '',
site: this.$store.state.user.site,
itemNo:'',
startDate:new Date(),
endDate:'',
operatorName:'',
resourceId:'',
shiftNo:'',
},
}
},
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);//100
let D = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//100
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;
},
},
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>

2
src/views/modules/schedule/closeSchedule.vue

@ -98,7 +98,7 @@
label="操作">
<template slot-scope="scope" class="foo_container">
<a v-if="scope.row.circulationSeqNo===null" type="text" size="small" @click="closeSchedule(scope.row)">关闭派工单</a>
<a v-if="scope.row.circulationSeqNo!=null" type="text" size="small" >派工单已流转</a>
<span v-if="scope.row.circulationSeqNo!=null" size="small" >派工单已流转</span>
<a v-if="scope.row.circulationSeqNo==null" type="text" size="small" @click="cancelJob(scope.row)">取消派工单</a>
<a v-if="scope.row.circulationSeqNo===null" type="text" size="small" @click="circulation(scope.row)">流转</a>
</template>

791
src/views/modules/schedule/generateReport.vue

@ -0,0 +1,791 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'工厂编码'">
<el-input v-model="searchData.site" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'派工单号'">
<el-input v-model="searchData.seqNo" type="number" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'生产订单号'">
<el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码</a></span>
<el-input v-model="searchData.sWorkCenterNo" style="width: 120px"></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.itemDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'派工单是否关闭'">
<el-select v-model="searchData.reportFlag" style="width: 120px">
<el-option label="全部" value=""></el-option>
<el-option label="是" value="closedFlag='Y'"></el-option>
<el-option label="否" value="closedFlag='N'"></el-option>
</el-select>
</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,3)"><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.sResourceID" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'班次'">
<el-select v-model="searchData.sShiftNo" 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="exportDataStandard"
:data="tableData"
type="xlsx"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:defaultValue="exportDefaultValue"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{'导出'}}
</download-excel>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
<el-form-item :label="' '">
<el-button @click="openStart()" style="margin-left: 0px;margin-top:0px" type="primary">派工单开始</el-button>
<el-button @click="openScan()" style="margin-left: 0px;margin-top:0px" type="primary">派工单报工</el-button>
<download-excel
:fields="exportDataStandard"
:data="tableData"
type="xlsx"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:defaultValue="exportDefaultValue"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
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"
align="center"
min-width="100"
label="操作">
<template slot-scope="scope" class="foo_container">
<a type="text" size="small" @click="initReportModal(scope.row)">报工</a>
</template>
</el-table-column>
<el-table-column
prop="site"
header-align="center"
align="left"
min-width="60"
label="工厂编码">
</el-table-column>
<el-table-column
prop="seqNo"
header-align="center"
align="left"
min-width="70"
label="派工单号">
</el-table-column>
<el-table-column
prop="orderNo"
header-align="center"
align="left"
min-width="100"
label="生产订单号">
</el-table-column>
<el-table-column
prop="sScheduledDate"
header-align="center"
align="left"
min-width="80"
label="派工日期">
</el-table-column>
<el-table-column
prop="operatorName"
header-align="center"
align="left"
min-width="80"
label="操作员姓名">
</el-table-column>
<el-table-column
prop="partNo"
header-align="center"
align="left"
min-width="80"
label="产品编码">
</el-table-column>
<el-table-column
prop="partDesc"
header-align="center"
align="left"
min-width="200"
label="产品名称">
</el-table-column>
<el-table-column
prop="itemNo"
header-align="center"
align="left"
min-width="70"
label="工序号">
</el-table-column>
<el-table-column
prop="itemDesc"
header-align="center"
align="left"
min-width="160"
label="工序名称">
</el-table-column>
<el-table-column
prop="qtyRequired"
header-align="center"
align="right"
min-width="80"
label="派工数量">
</el-table-column>
<el-table-column
prop="qtyReported"
header-align="center"
align="right"
min-width="80"
label="报工数量">
</el-table-column>
<el-table-column
prop="qtyApprove"
header-align="center"
align="right"
min-width="80"
label="合格数量">
</el-table-column>
<el-table-column
prop="timeRequired"
header-align="center"
align="right"
min-width="80"
label="需求时间">
</el-table-column>
<el-table-column
prop="sResourceID"
header-align="center"
align="left"
min-width="70"
label="机台ID">
</el-table-column>
<el-table-column
prop="sShiftNo"
header-align="center"
align="left"
min-width="70"
label="班次">
</el-table-column>
<el-table-column
prop="sWorkCenterNo"
header-align="center"
align="left"
min-width="100"
label="加工中心编码">
</el-table-column>
</el-table>
<el-dialog title="扫描派工单" :close-on-click-modal="false" v-drag :visible.sync="scanModalFlag" width="215px" >
<el-form :inline="true" label-position="top" style="margin-left: 22px;margin-top: -5px;" @submit.native.prevent>
<el-form-item :label="'派工单号:'">
<el-input v-model="scanSeqNo" ref="input" type="number" style="width: 130px;" @keyup.enter.native="searchSeqNo()"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="searchSeqNo()">搜索</el-button>
<el-button type="primary" @click="scanModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="开始派工单" :close-on-click-modal="false" v-drag :visible.sync="startModalFlag" width="215px">
<el-form :inline="true" label-position="top" style="margin-left: 22px;margin-top: -5px;" @submit.native.prevent>
<el-form-item :label="'派工单号:'">
<el-input v-model="scanSeqNo" ref="start" type="number" style="width: 130px;" @keyup.enter.native="startSeqNo()"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="startSeqNo()">开始</el-button>
<el-button type="primary" @click="startModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog @close="closeDialog" :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="报告信息" :visible.sync="setUp.reviewFlag" width="615px">
<el-form :inline="true" label-position="top">
<el-form-item label="派工单号">
<el-input style="width: 130px;" :disabled="setUp.disabled" onkeyup="this.value = this.value.toUpperCase()" v-model="saveHeaderData.seqNo"></el-input>
</el-form-item>
<el-form-item label="产品编码">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.partNo"></el-input>
</el-form-item>
<el-form-item label="产品名称/规格型号">
<el-input style="width: 275px;" :disabled="setUp.disabled" v-model="saveHeaderData.partDescription"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item label="工序号">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.itemNo"></el-input>
</el-form-item>
<el-form-item label="工序名称">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.operationDesc"></el-input>
</el-form-item>
<el-form-item label="加工中心编码">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.workCenterNo"></el-input>
</el-form-item>
<el-form-item label="加工中心名称">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.workCenterDesc"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item>
<span slot="label" style="" @click="getBaseList(26 ,1)"><a herf="#">操作员</a></span>
<el-input style="width: 130px;" v-model="saveHeaderData.operatorId"></el-input>
</el-form-item>
<el-form-item label="操作员姓名">
<el-input style="width: 130px;" v-model="saveHeaderData.operatorName"></el-input>
</el-form-item>
<el-form-item label="生产日期">
<el-date-picker
style="width: 130px"
v-model="saveHeaderData.planStartTime"
type="date"
value-format="yyyy-MM-dd"
format = "yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="报告日期">
<el-date-picker
style="width: 130px"
v-model="saveHeaderData.planFinishTime"
type="date"
value-format="yyyy-MM-dd"
format = "yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item label="本工序报工数">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="qty1"></el-input>
</el-form-item>
<el-form-item label="上工序报工数">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="qty2"></el-input>
</el-form-item>
<el-form-item label="本派工单数量">
<el-input style="width: 130px;" disabled v-model="saveHeaderData.qtyRequire"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item label="合格数量">
<el-input type="number" style="width: 178px;" class="input_reight" v-model="saveHeaderData.qtyApprove" ></el-input>
</el-form-item>
<el-form-item label="不合格数量" >
<el-input type="number" class="input_left" style="width: 178px;" v-model="saveHeaderData.qtyUnApprove" ></el-input>
</el-form-item>
</el-form>
<fieldset class="customer-fieldset" style="width: 597px;margin-left: -10px;">
<legend class="customer-legend">不良品分析</legend>
<el-form :inline="true" label-position="top">
<el-form-item>
<span slot="label" style="" @click="getBaseList(26 ,2)"><a herf="#">操作员</a></span>
<el-input style="width: 178px;" v-model="saveHeaderData.operatorId2"></el-input>
</el-form-item>
<el-form-item label="操作员姓名">
<el-input style="width: 178px;" v-model="saveHeaderData.operatorIdName2"></el-input>
</el-form-item>
<el-form-item label="报废原因">
<el-input style="width: 178px;" v-model="saveHeaderData.scrapReason"></el-input>
</el-form-item>
</el-form>
</fieldset>
<el-form :inline="true" label-position="top">
<el-form-item label="准备时间">
<el-input type="number" style="width: 178px;text-align: right;" v-model="saveHeaderData.preparationTime" ></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
<!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.preparationTime" size="medium" :min="0" :controls="false"></el-input-number>-->
</el-form-item>
<el-form-item label="制造时间">
<el-input type="number" style="width: 178px;" v-model="saveHeaderData.manufacturingTime"></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
<!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.manufacturingTime" size="medium" :min="0" :controls="false"></el-input-number>-->
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item label="备注">
<el-input style="width: 560px;" v-model="saveHeaderData.remark"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="setUp.reviewFlag = false">取消</el-button>
<el-button type="primary" :disabled="setUp.saveButton" @click="saveReport()">确定</el-button>
</span>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getSOScheduleRoutingData
, saveGenerateReportForSchedule,
searchReportedQty,
searchSeqNo,
startSeqNo,
} from '@/api/production/schedule.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default {
name: 'generateReport',
components: {
Chooselist
},
data () {
return {
cavity:'',
setUp: {
reviewFlag: false,
saveButton: false,
readonlyFlag: false,
disabled: false
},
factorFlag:false,
abnormalList:[],
saveHeaderData: {
qtyRequire:'',
qtyUnApprove:'',
site: '',
seqNo: '',
itemNo: '',
partNo: '',
partDescription: '',
operationDesc: '',
workCenterNo: '',
workCenterDesc: '',
operatorId: '',
operatorName: '',
planStartTime: '',
planFinishTime: '',
qtyReported: 0,
qtyApprove: 0,
qtyRework: 0,
operatorId2: '',
operatorIdName2: '',
scrapReason: '',
preparationTime: 0,
manufacturingTime: 0,
cleaningTime: 0,
shutdownReason: '',
remark: '',
orderRef1:'',
scheduleType:'',
userId:'',
},
scanSeqNo:'',
stopModalFlag:false,
continueModalFlag:false,
qty1:'',
qty2:'',
site: '',
operatorType: 0,
// start
exportData: [],
exportDataStandard: {
'派工单号': 'seqNo',
'关联单号': 'orderNo',
'关联单号类型': 'scheduleType',
'工序号': 'itemNo',
'工序名称': 'itemDesc',
'派工数量': 'qtyRequired',
'报工数量': 'qtyReported',
'合格数量': 'qtyApprove',
'需求时间': 'timeRequired',
'派工日期': 'sScheduledDate',
'操作员姓名': 'operatorName',
'产品编码': 'partNo',
'产品名称': 'partDesc',
'机台ID': 'sResourceID',
'班次': 'sShiftNo',
'加工中心': 'sWorkCenterNo',
},
exportName: '派工单列表' + this.getStrDate(),
exportHeader: ['派工单列表'],
exportFooter: [],
exportDefaultValue: '这一行这一列没有数据',
// end
height: 200,
tableData: [],
searchData: {
userId:this.$store.state.user.name,
orderNo: '',
sWorkCenterNo: '',
partNo: '',
site: '',
itemDesc:'',
scheduleType:'',
reportFlag:"closedFlag='N'",
startDate:'',
endDate:'',
operatorName:'',
sResourceID:'',
sShiftNo:'',
seqNo:'',
},
scanModalFlag:false,
currentData:'',
tagNo2:'',
startModalFlag:false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 210
})
},
methods: {
saveReport () {
this.saveHeaderData.qtyReported=Number(this.saveHeaderData.qtyUnApprove)+Number(this.saveHeaderData.qtyApprove);
if (this.saveHeaderData.qtyUnApprove == null || this.saveHeaderData.qtyUnApprove < 0) {
this.$alert('不合格数量错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.qtyApprove == null || this.saveHeaderData.qtyApprove < 0) {
this.$alert('合格数量错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.qtyRework == null || this.saveHeaderData.qtyRework <0) {
this.$alert('返工数量错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.preparationTime == null || this.saveHeaderData.preparationTime < 0) {
this.$alert('准备时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.manufacturingTime == '' || this.saveHeaderData.manufacturingTime == null || this.saveHeaderData.manufacturingTime < 0) {
this.$alert('制造时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.cleaningTime == null || this.saveHeaderData.cleaningTime < 0) {
this.$alert('清理时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.planStartTime == null || this.saveHeaderData.planStartTime === '') {
this.$alert('请选择生产日期!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.planFinishTime == null || this.saveHeaderData.planFinishTime === '') {
this.$alert('请选择报告日期!', '错误信息', {
confirmButtonText: '确定'
})
return
}
this.setUp.saveButton=true;
saveGenerateReportForSchedule(this.saveHeaderData).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.setUp.reviewFlag = false
this.search()
} else {
this.setUp.saveButton=false;
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo2 = type
this.$nextTick(() => {
let strVal = ''
if (val === 24) {
strVal = this.searchData.sWorkCenterNo
}
if (val === 5) {
strVal = this.searchData.partNo
}
if (val === 26) {
if(type==1) {
strVal = this.saveHeaderData.operatorId
}else if(type==2){
strVal = this.saveHeaderData.operatorId2
}else {
strVal = this.searchData.operatorName
}
}
if (val === 88) {
strVal = this.searchData.sResourceID
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 24) {
this.searchData.sWorkCenterNo = val.WorkCenterNo
} else if (this.tagNo === 5) {
this.searchData.partNo = val.PartNo
}
if (this.tagNo === 26) {
if(this.tagNo2==1) {
this.saveHeaderData.operatorId = val.OperatorID
this.saveHeaderData.operatorName = val.OperatorName
}else if(this.tagNo2==2){
this.saveHeaderData.operatorId2 = val.OperatorID
this.saveHeaderData.operatorIdName2 = val.OperatorName
}else {
this.searchData.operatorName = val.OperatorName
}
}
if (this.tagNo === 88) {
this.searchData.sResourceID = val.ResourceID
}
},
initReportModal (row) {
this.scanSeqNo=row.seqNo
this.searchSeqNo()
},
closeDialog () {
Object.assign(this.$data.saveHeaderData, this.$options.data.call(this).saveHeaderData)
},
search () {
getSOScheduleRoutingData(this.searchData).then(({data}) => {
this.tableData = data.rows
})
},
createExportData () {
return this.tableData
},
startDownload () {
// this.exportData = this.dataList
},
finishDownload () {
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
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
},
openScan(){
this.scanSeqNo='';
this.scanModalFlag=true;
this.$nextTick(() => { this.$refs.input.focus();})
},
openStart(){
this.scanSeqNo='';
this.startModalFlag=true;
this.$nextTick(() => { this.$refs.start.focus();})
},
searchSeqNo(){
if(this.scanSeqNo==''){
this.$alert("请扫描派工单!",'错误', {
confirmButtonText: '确定'
})
return false;
}
let inData={
userId:this.$store.state.user.name,
seqNo:this.scanSeqNo
}
searchSeqNo(inData).then(({data}) => {
if (data.code == 0) {
if(data.row==null){
this.scanSeqNo=''
this.$alert("派工单不存在!",'错误', {
confirmButtonText: '确定'
})
return false;
}
let currentData = data.row;
if(currentData.closedFlag=='Y'){
this.scanSeqNo=''
this.$alert("该派工单已关闭!",'错误', {
confirmButtonText: '确定'
})
return false;
}
this.saveHeaderData.qtyApprove=0
this.saveHeaderData.qtyUnApprove=0
this.saveHeaderData.qtyRework=0
this.saveHeaderData.moldQty=0
this.saveHeaderData.reportWeight=0
this.saveHeaderData.approveWeight=0
this.saveHeaderData.site = currentData.site;
this.saveHeaderData.seqNo = currentData.seqNo;
this.saveHeaderData.itemNo = currentData.itemNo;
this.saveHeaderData.operationDesc = currentData.itemDesc;
this.saveHeaderData.partNo = currentData.partNo;
this.saveHeaderData.partDescription = currentData.partSpec;
this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo;
this.saveHeaderData.workCenterDesc = currentData.workCenterDesc;
this.saveHeaderData.orderRef1=currentData.orderRef1;
this.saveHeaderData.orderNo=currentData.orderNo;
this.saveHeaderData.scheduleType=currentData.scheduleType;
this.saveHeaderData.operatorId=currentData.operatorId;
this.saveHeaderData.operatorName=currentData.operatorName;
this.saveHeaderData.qtyRequire=currentData.qtyRequired;
this.saveHeaderData.userId=this.$store.state.user.name;
this.saveHeaderData.manufacturingTime='';
this.qty1='';
this.qty2 ='';
this.saveHeaderData.planStartTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
this.saveHeaderData.planFinishTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
searchReportedQty(this.saveHeaderData).then(({data}) => {
if(data.code===0) {
this.qty1 = data.row.qtyReported;
this.qty2 = data.row.lastApproveQty;
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
return false;
}
})
this.scanModalFlag=false;
this.setUp.reviewFlag = true;
this.setUp.saveButton=false;
this.setUp.disabled = true;
// getSOScheduleRoutingData(inData).then(({data}) => {
// if( data.rows){
// if(data.rows.length>0){
// data.rows[0].weight= Number(data.rows[0].weight.toFixed(2))
// data.rows[0].type='jianyan'
//
//
// }
// }
// })
} else {
this.scanSeqNo=''
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
startSeqNo(){
let inData={
username:this.$store.state.user.name,
seqNo:this.scanSeqNo,
}
startSeqNo(inData).then(({data}) => {
if (data && data.code === 0) {
this.scanSeqNo='';
this.startModalFlag=false;
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.scanSeqNo='';
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
},
created () {
}
}
</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;
}
.big /deep/ .el-form-item__label {
font-size: 17px;
}
.big /deep/ .el-input__inner {
height: 22px !important;
font-size: 17px;
}
.big /deep/ .el-dialog__title {
font-size: 17px;
font-weight: bold;
}
</style>

579
src/views/modules/schedule/searchSfdc.vue

@ -0,0 +1,579 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'派工单号'">
<el-input v-model="searchData.seqNo" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" style="width: 130px"></el-input>
</el-form-item>
<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: 120px"></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
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>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getSfdcList,
} from '@/api/production/schedule.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default {
name: 'searchSfdc',
components: {
Chooselist
},
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: "partDesc",
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: "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: 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: "statisticDate",
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,
// end
height: 200,
tableData: [],
searchData: {
seqNo:'',
orderNo: '',
workCenterNo: '',
partNo: '',
site: this.$store.state.user.site,
itemNo:'',
startDate:new Date(),
endDate:'',
operatorName:'',
resourceId:'',
shiftNo:'',
},
}
},
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
})
},
// +
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);//100
let D = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//100
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;
},
},
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>

2
src/views/modules/schedule/soscheduleRouting.vue

@ -276,7 +276,7 @@
import Chooselist from '@/views/modules/common/Chooselist'
import {
printSeqNoLabel,
} from "@/views/modules/print/print_seqNo_label.js"
} from "@/views/modules/print/label/print_seqNo_label.js"
export default {
name: 'soscheduleRouting',
components: {

Loading…
Cancel
Save