Browse Source

去掉pdf插件 无用 导致打包失误

master
ruanqi 2 years ago
parent
commit
fd86d2b80c
  1. 14
      src/api/production.js
  2. 796
      src/views/modules/production/dailyPlan.vue
  3. 441
      src/views/modules/production/searchDailyPlan.vue
  4. 13
      src/views/modules/schedule/generateReport.vue
  5. 808
      src/views/modules/schedule/scheduleForSOTask.vue

14
src/api/production.js

@ -17,3 +17,17 @@ export const deleteSkill=data => createAPI(`schedule/deleteSkill`, 'post', data)
export const getAllDepartment= data => createAPI(`schedule/getAllDepartment`, 'post', data);
export const updateTV=data => createAPI(`schedule/updateTV`, 'post', data);
export const getShopOrderData= data => createAPI(`dailyPlan/getShopOrderData`, 'post', data);
export const getSchedulingSize= data => createAPI(`dailyPlan/getSchedulingSize`, 'post', data);
export const savePlan= data => createAPI(`dailyPlan/savePlan`, 'post', data);
export const getWorkPlanData= data => createAPI(`dailyPlan/getWorkPlanData`, 'post', data);
export const delPlan= data => createAPI(`dailyPlan/delPlan`, 'post', data);
export const savePlans= data => createAPI(`dailyPlan/savePlans`, 'post', data);
export const getDailyPlanData= data => createAPI(`dailyPlan/getDailyPlanData`, 'post', data);
export const getSOTastRoutingData= data => createAPI(`dailyPlan/getSOTastRoutingData`, 'post', data);
export const getWorkCenterOperatorList= data => createAPI(`dailyPlan/getWorkCenterOperatorList`, 'post', data);
export const getAvailableResourceList= data => createAPI(`dailyPlan/getAvailableResourceList`, 'post', data);
export const scheduleForSOTask= data => createAPI(`dailyPlan/scheduleForSOTask`, 'post', data);
export const getDailyPlanRouteDetailData= data => createAPI(`dailyPlan/getDailyPlanRouteDetailData`, 'post', data);
export const getDailyPlanScheduleDetailData= data => createAPI(`dailyPlan/getDailyPlanScheduleDetailData`, 'post', data);

796
src/views/modules/production/dailyPlan.vue

@ -0,0 +1,796 @@
<template>
<div class="mod-config">
<el-form inline="true" v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'工厂编号:'">
<el-input v-model="searchData.site" style="width: 120px"></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 :label="'计划开工日期:'">
<el-date-picker
style="width: 130px"
v-model="searchData.startDate2"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-top: 23px;">
<laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
</el-form-item>
<el-form-item :label="' '">
<el-date-picker
style="width: 130px"
v-model="searchData.endDate2"
type="date"
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.startDate3"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-top: 23px;">
<laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
</el-form-item>
<el-form-item :label="' '">
<el-date-picker
style="width: 130px"
v-model="searchData.endDate3"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
<el-form-item :label="'状态:'">
<el-select filterable v-model="searchData.status" 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-date-picker
style="width: 130px"
v-model="searchData.startDate1"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-top: 23px;">
<laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
</el-form-item>
<el-form-item :label="' '">
<el-date-picker
style="width: 130px"
v-model="searchData.endDate1"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</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: 130px"></el-input>
</el-form-item>
<el-form-item :label="'规格型号:'">
<el-input v-model="searchData.partDescription" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'排产情况:'">
<el-select filterable v-model="searchData.planStatus" style="width: 120px">
<el-option label="全部" value=""></el-option>
<el-option label="未排产完" value="ROUND(a.LotSize,3) >ROUND(ISNULL(so.scheduling_size,0),3)"></el-option>
<el-option label="已排产完" value="ROUND(ISNULL(so.scheduling_size,0),3) >=ROUND(a.LotSize,3)"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="search()" style="margin-left: 24px" type="primary">查询</el-button>
</el-form-item>
</el-form>
</el-form>
<el-table
:height="height"
:data="tableData"
border
style="width: 100%">
<el-table-column
prop=""
header-align="center"
align="center"
min-width="30"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="openScheduleModel(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="orderNo"
header-align="center"
align="left"
min-width="60"
label="订单号">
</el-table-column>
<el-table-column
prop="partNo"
header-align="center"
align="left"
min-width="60"
label="物料编码">
</el-table-column>
<el-table-column
prop="partDescription"
header-align="center"
align="left"
min-width="200"
label="物料名称">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="left"
min-width="40"
label="状态">
</el-table-column>
<el-table-column
prop="planStartDate"
header-align="center"
align="left"
min-width="50"
label="计划开工日期">
</el-table-column>
<el-table-column
prop="needDate"
header-align="center"
align="left"
min-width="50"
label="要求完工日期">
</el-table-column>
<el-table-column
prop="lotSize"
header-align="center"
align="right"
min-width="40"
label="订单数量">
</el-table-column>
<el-table-column
prop="schedulingSize"
header-align="center"
align="right"
min-width="40"
label="已排产数量">
</el-table-column>
<el-table-column
prop="enterDate"
header-align="center"
align="left"
min-width="80"
label="录入时间">
</el-table-column>
<el-table-column
prop="userName"
header-align="center"
align="left"
min-width="40"
label="录入人">
</el-table-column>
</el-table>
<el-dialog title="排产信息" :visible.sync="schedulingFlag" :close-on-click-modal="false" v-drag width="86 0px">
<el-form :inline="true" label-position="top">
<el-form-item :label="'订单号:'">
<el-input v-model="scheduledModelData.orderNo" readonly style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'计划开工日期:'">
<el-input v-model="scheduledModelData.planStartDate" readonly style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'要求完工日期:'">
<el-input v-model="scheduledModelData.needDate" readonly style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'已排产数量:'">
<el-input v-model="scheduledModelData.schedulingSize" readonly style="width: 100px"></el-input>
</el-form-item>
<el-form-item :label="'未排产数量:'">
<el-input v-model="scheduledModelData.unSchedulingSize" readonly style="width: 100px"></el-input>
</el-form-item>
<el-form-item :label="'生产订单状态:'">
<el-input v-model="scheduledModelData.status" readonly style="width: 100px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="schedulings()" type="primary" :disabled="closeFlag" style="margin-top: 0px;margin-left: 0px;">批量新增</el-button>
<el-button @click="schedulingModal()" type="primary" :disabled="closeFlag" style="margin-top: 0px;">新增</el-button>
</el-form-item>
</el-form>
<el-table
:height="300"
:data="scheduleTableData"
border
style="width: 100%">
<el-table-column
prop="orderDate"
header-align="center"
align="left"
min-width="40"
label="计划日期">
</el-table-column>
<el-table-column
prop="orderNo"
header-align="center"
align="left"
min-width="50"
label="日计划号">
</el-table-column>
<el-table-column
prop="orderQty"
header-align="center"
align="right"
min-width="40"
label="排产数量">
</el-table-column>
<el-table-column
prop="userName"
header-align="center"
align="left"
min-width="40"
label="录入人">
</el-table-column>
<el-table-column
prop="enterDate"
header-align="center"
align="center"
min-width="60"
label="录入日期">
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="40"
label="操作">
<template slot-scope="scope" class="foo_container">
<a type="text" size="small" :v-if="!closeFlag" @click="editSchedule(scope.row)">编辑</a>
<a type="text" size="small" @click="deleteSchedule(scope.row)">取消</a>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="schedulingFlag = false">取消</el-button>
<!-- <el-button type="primary" :disabled="bannersBut" @click="saveBanners()">确定</el-button>-->
</el-footer>
</el-dialog>
<el-dialog title="维护日计划" :close-on-click-modal="false" v-drag :visible.sync="schedulingModalFlag" width="341px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'订单号:'">
<el-input v-model="scheduledingData.orderNo" disabled style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'计划日期:'">
<el-date-picker
style="width: 130px"
v-model="scheduledingData.orderDate"
type="date"
value-format="yyyy-MM-dd"
:disabled="scheduledingDataFlag1"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'计划数量:'">
<el-input v-model="scheduledingData.orderQty" style="width: 130px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" v-if="scheduledingDataFlag3" @click="planSaveOn()">保存并继续</el-button>
<el-button type="primary" @click="planSave()">保存</el-button>
<el-button type="primary" @click="schedulingModalFlag = false">取消</el-button>
</el-footer>
</el-dialog>
<el-dialog title="批量排产" :close-on-click-modal="false" v-drag :visible.sync="schedulingsFlag" width="500px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'订单号:'">
<el-input v-model="scheduledingsData.orderNo" disabled style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'计划开始日期:'">
<el-date-picker
style="width: 130px"
v-model="scheduledingsData.orderDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'排产总数:'">
<el-input v-model="scheduledingsData.qty" style="width: 130px" ></el-input>
</el-form-item>
<el-form-item :label="'计划天数:'">
<el-input v-model="scheduledingsData.dayQty" style="width: 130px;" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="plansSave()">保存</el-button>
<el-button type="primary" @click="schedulingsFlag = false">取消</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getShopOrderData,
getSchedulingSize,
savePlan,
getWorkPlanData,
delPlan,
savePlans
} from '@/api/production.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default {
name: 'productionDispatch',
components: {
Chooselist
},
data () {
return {
schedulingsFlag: false,
//
schedulingModalFlag: false,
scheduleTableData: [],
scheduledModelData: {
status:'',
orderNo: '',
planStartDate: '',
needDate: '',
schedulingSize: '',
unSchedulingSize: '',
site:'',
},
closeFlag:false,
dataListSelections: [],
scheduledingData: {
orderNo: '',
orderDate: '',
orderQty: '',
userName: this.$store.state.user.name,
lotSize: '',
planStartDate: '',
needDate: '',
site: '',
productionType: '生产订单',
planAdd: 0,
partNo: ''
},
scheduledingsData: {
orderNo: '',
orderDate: '',
orderQty: '',
qty: '',
dayQty: '',
userName: this.$store.state.user.name,
lotSize: '',
planStartDate: '',
needDate: '',
site: '',
productionType: '生产订单',
planAdd: 0,
partNo: ''
},
scheduledingDataFlag1: false,
scheduledingDataFlag3: true,
schedulingFlag: false,
tableData: [],
searchData: {
partDescription:'',
orderNo: '',
startDate1: new Date(),
endDate1: '',
startDate2: '',
endDate2: '',
status: '(\'已下达\',\'已发料\',\'已入库\',\'已开工\',\'已排产\')',
partNo: '',
startDate3: '',
endDate3: '',
site: '',
planStatus: 'ROUND(a.LotSize,3) >ROUND(ISNULL(so.scheduling_size,0),3)'
},
// table
height: 200,
tagNo:'',
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 240
})
},
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 () {
this.getData()
},
//
schedulingModal () {
if (this.scheduledModelData.unSchedulingSize == 0) {
this.$alert('该日计划已排产完毕无需新增!', '错误', {
confirmButtonText: '确定'
})
return false
}
this.scheduledingDataFlag1 = false
this.scheduledingDataFlag3 = true
this.scheduledingData.userName = this.$store.state.user.name
this.scheduledingData.planStartDate = this.scheduledModelData.planStartDate
this.scheduledingData.needDate = this.scheduledModelData.needDate
this.scheduledingData.site = this.scheduledModelData.site
this.scheduledingData.orderNo = this.scheduledModelData.orderNo
this.scheduledingData.orderDate = this.scheduledModelData.planStartDate
this.scheduledingData.planAdd = 0
this.scheduledingData.orderQty = ''
this.schedulingModalFlag = true
},
schedulings(){
if (this.scheduledModelData.unSchedulingSize == 0) {
this.$alert('该日计划已排产完毕无需新增!', '错误', {
confirmButtonText: '确定'
})
return false
}
this.scheduledingsData.userName = this.$store.state.user.name
this.scheduledingsData.planStartDate = this.scheduledModelData.planStartDate
this.scheduledingsData.needDate = this.scheduledModelData.needDate
this.scheduledingsData.orderNo = this.scheduledModelData.orderNo
this.scheduledingsData.site = this.scheduledModelData.site
this.scheduledingsData.orderDate = this.scheduledModelData.planStartDate
this.scheduledingsData.planAdd = 0
this.scheduledingsData.orderQty = ''
this.scheduledingsData.qty=''
this.scheduledingsData.dayQty=''
this.scheduledingsData.orderQty=''
this.schedulingsFlag = true
},
//
openScheduleModel (row) {
// if (row.status == '' || row.status == '') {
// this.$alert('' + row.status + '', '', {
// confirmButtonText: ''
// })
// return false
// }
if (row.status == '已计划' || row.status == '已关闭') {
this.closeFlag=true;
}else {
this.closeFlag=false;
}
let list = {site:row.site,orderNo: row.orderNo}
getSchedulingSize(list).then(({data}) => {
this.scheduledModelData.schedulingSize = data.schedulingSize.toFixed(1)
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize)
})
this.scheduledModelData.status = row.status
this.scheduledingData.lotSize = row.lotSize
this.scheduledingData.site = row.site
this.scheduledingData.partNo = row.partNo
this.scheduledModelData.site = row.site
this.scheduledingsData.lotSize = row.lotSize
this.scheduledingsData.partNo = row.partNo
this.scheduledModelData.needDate = row.needDate
this.scheduledModelData.planStartDate = row.planStartDate
this.scheduledModelData.orderNo = row.orderNo
this.schedulingFlag = true
let data1 = {site:row.site,orderNo: row.orderNo}
getWorkPlanData(data1).then(({data}) => {
this.scheduleTableData = data.rows
})
},
//
getData () {
getShopOrderData(JSON.parse(JSON.stringify(this.searchData))).then(({data}) => {
this.tableData = data.rows
})
},
planSave () {
if (this.scheduledingData.orderDate == '' || this.scheduledingData.orderDate == null) {
this.$alert('请选择计划日期!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledingData.orderQty == '' || this.scheduledingData.orderQty == null) {
this.$alert('请输入排产数量!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledingData.orderQty <= 0) {
this.$alert('排产数量必须大于0!', '错误', {
confirmButtonText: '确定'
})
return false
}
savePlan(this.scheduledingData).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModelData.schedulingSize = data.schedulingSize.toFixed(1);
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize.toFixed(1))
this.schedulingModalFlag = false
let data1 = {site:this.scheduledModelData.site,orderNo: this.scheduledModelData.orderNo}
getWorkPlanData(data1).then(({data}) => {
this.scheduleTableData = data.rows
})
this.getData()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
plansSave(){
if (this.scheduledingsData.orderDate == '' || this.scheduledingsData.orderDate == null) {
this.$alert('请选择计划日期!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledingsData.qty == '' || this.scheduledingsData.qty == null) {
this.$alert('请输入排产总数!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledingsData.dayQty == '' || this.scheduledingsData.dayQty == null) {
this.$alert('请输入计划天数!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledingsData.dayQty > 30 ) {
this.$alert('计划天数不可大于30天!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledingsData.qty <= 0) {
this.$alert('排产总数量必须大于0!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledModelData.unSchedulingSize<this.scheduledingsData.qty) {
this.$alert('可排产数量小于计划数量!', '错误', {
confirmButtonText: '确定'
})
return false
}
let num=this.scheduledingsData.qty/this.scheduledingsData.dayQty;
if(Math.round(num)==num){
this.scheduledingsData.orderQty=num;
}else{
this.scheduledingsData.orderQty=num.toFixed(1);
}
let scheduledList=[];
let theOrderDate= this.getLastDay(this.scheduledingsData.orderDate)
for (let i = 0; i < this.scheduledingsData.dayQty; i++) {
theOrderDate=this.getNextDay(theOrderDate);
let listData={
"orderNo": this.scheduledingsData.orderNo,
"orderDate": theOrderDate,
"orderQty": this.scheduledingsData.orderQty,
"userName": this.$store.state.user.name,
"planStartDate": this.scheduledingsData.planStartDate,
"needDate": this.scheduledingsData.needDate,
"site": this.scheduledingsData.site,
"productionType": '生产订单',
"partNo": this.scheduledingsData.partNo,
"lotSize": this.scheduledingsData.lotSize,
"planAdd": 0
}
scheduledList.push(listData);
}
savePlans(JSON.stringify(scheduledList)).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModelData.schedulingSize = data.schedulingSize.toFixed(1)
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize.toFixed(1))
this.schedulingsFlag = false
let data1 = {site:this.scheduledModelData.site,orderNo: this.scheduledModelData.orderNo}
getWorkPlanData(data1).then(({data}) => {
this.scheduleTableData = data.rows
})
this.getData();
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
planSaveOn () {
if (this.scheduledingData.orderDate == '' || this.scheduledingData.orderDate == null) {
this.$alert('请选择计划日期!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledingData.orderQty == '' || this.scheduledingData.orderQty == null) {
this.$alert('请输入排产数量!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.scheduledingData.orderQty <= 0) {
this.$alert('排产数量必须大于0!', '错误', {
confirmButtonText: '确定'
})
return false
}
savePlan(this.scheduledingData).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModelData.schedulingSize = data.schedulingSize.toFixed(1);
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize.toFixed(1));
let data1 = {site:this.scheduledModelData.site,orderNo: this.scheduledModelData.orderNo}
getWorkPlanData(data1).then(({data}) => {
this.scheduleTableData = data.rows
})
this.getData();
this.scheduledingData.orderDate=this.getNextDay(this.scheduledingData.orderDate);
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
//
editSchedule (row) {
this.scheduledingDataFlag1 = true
this.scheduledingDataFlag3 = false
this.scheduledingData.userName = this.$store.state.user.name
this.scheduledingData.planStartDate = this.scheduledModelData.planStartDate
this.scheduledingData.needDate = this.scheduledModelData.needDate
this.scheduledingData.orderNo = this.scheduledModelData.orderNo
this.scheduledingData.site = this.scheduledModelData.site
this.scheduledingData.orderDate = row.orderDate
this.scheduledingData.planAdd = 1
this.scheduledingData.orderQty = row.orderQty
this.schedulingModalFlag = true
},
//
deleteSchedule (row) {
let delData = {
site:row.site,
orderNo: row.orderNo,
orderQty: row.orderQty,
orderRef1: row.orderRef1
}
this.$confirm(`是否取消此条日计划?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPlan(delData).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModelData.schedulingSize = data.schedulingSize.toFixed(1)
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize.toFixed(1));
this.getData()
let data1 = {site:this.scheduledModelData.site,orderNo: this.scheduledModelData.orderNo}
getWorkPlanData(data1).then(({data}) => {
this.scheduleTableData = data.rows
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
getNextDay(dateTime){
var dd =new Date(dateTime);
dd.setDate(dd.getDate()+1);//1
var y = dd.getFullYear();
var m = (dd.getMonth()+1)<10?"0"+(dd.getMonth()+1):(dd.getMonth()+1);//获取当前月份的日期不足10补0
var d = dd.getDate()<10?"0"+dd.getDate():dd.getDate();//获取当前几号不足10补0
// let haha= new Date(y+"-"+m+"-"+d);
return y+"-"+m+"-"+d;
},
getLastDay(dateTime){
var dd =new Date(dateTime);
dd.setDate(dd.getDate()-1);//1
var y = dd.getFullYear();
var m = (dd.getMonth()+1)<10?"0"+(dd.getMonth()+1):(dd.getMonth()+1);//获取当前月份的日期不足10补0
var d = dd.getDate()<10?"0"+dd.getDate():dd.getDate();//获取当前几号不足10补0
// let haha= new Date(y+"-"+m+"-"+d);
return y+"-"+m+"-"+d;
},
getTime (date) {
if (date == '') {
return ''
} else {
let json_date = new Date(date).toJSON()
return new Date(new Date(json_date) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
}
},
},
created () {
}
}
</script>

441
src/views/modules/production/searchDailyPlan.vue

@ -0,0 +1,441 @@
<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: 120px"></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 :label="'订单号:'">
<el-input v-model="searchData.orderRef1" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料编码 :'">
<el-input v-model="searchData.partNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'计划日期:'">
<el-date-picker
style="width: 130px"
v-model="searchData.startDate1"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-top: 23px;">
<laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
</el-form-item>
<el-form-item :label="' '">
<el-date-picker
style="width: 130px"
v-model="searchData.endDate1"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</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-table
:height="height"
:data="tableData"
border
style="width: 100%">
<el-table-column
prop=""
fixed="left"
header-align="center"
align="center"
min-width="60"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="openRouteModel(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="orderNo"
header-align="center"
align="left"
min-width="80"
label="日计划单号">
</el-table-column>
<el-table-column
prop="orderDate"
header-align="center"
align="left"
min-width="70"
label="计划日期">
</el-table-column>
<el-table-column
prop="orderRef1"
header-align="center"
align="left"
min-width="90"
label="订单号">
</el-table-column>
<el-table-column
prop="partNo"
header-align="center"
align="left"
min-width="70"
label="物料编码">
</el-table-column>
<el-table-column
prop="partDescription"
header-align="center"
align="left"
min-width="200"
label="物料名称">
</el-table-column>
<el-table-column
prop="orderQty"
header-align="center"
align="right"
min-width="60"
label="计划数量">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="partPlanQty"-->
<!-- header-align="center"-->
<!-- align="right"-->
<!-- min-width="60"-->
<!-- label="班产量">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="shiftQty"-->
<!-- header-align="center"-->
<!-- align="right"-->
<!-- min-width="60"-->
<!-- label="计划班数">-->
<!-- <template slot-scope="scope">-->
<!-- {{scope.row.partPlanQty<=0?0:(scope.row.orderQty*1.0/scope.row.partPlanQty).toFixed(1)}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="weight"-->
<!-- header-align="center"-->
<!-- align="right"-->
<!-- min-width="60"-->
<!-- label="参考数量">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="qtyfinished"-->
<!-- header-align="center"-->
<!-- align="right"-->
<!-- min-width="60"-->
<!-- label="已完工数">-->
<!-- </el-table-column>-->
<el-table-column
prop="userName"
header-align="center"
align="left"
min-width="50"
label="录入人">
</el-table-column>
<el-table-column
prop="enterDate"
header-align="center"
align="left"
min-width="100"
label="录入时间">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="reportTime"-->
<!-- 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="routeModalFlag" width="700px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="工厂编码:">
<el-input v-model="routeDetailData.site" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="日计划号:">
<el-input v-model="routeDetailData.orderNo" disabled style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-table
height="300"
:data="routeList"
border
style="width: 100%">
<el-table-column
prop=""
fixed="left"
header-align="center"
align="center"
width="40"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="openScheduleModel(scope.row)">明细</a>
</template>
</el-table-column>
<el-table-column
prop="itemNo"
header-align="center"
align="center"
min-width="40"
label="工序">
</el-table-column>
<el-table-column
prop="operationDesc"
header-align="center"
align="left"
min-width="60"
label="工序名称">
</el-table-column>
<el-table-column
prop="workCenterNo"
header-align="center"
align="left"
min-width="60"
label="加工中心编码">
</el-table-column>
<el-table-column
prop="workCenterDesc"
header-align="center"
align="left"
min-width="80"
label="加工中心">
</el-table-column>
<el-table-column
prop="qty"
header-align="center"
align="right"
min-width="70"
label="日计划数量">
</el-table-column>
<el-table-column
prop="scheduledQty"
header-align="center"
align="right"
min-width="70"
label="已派工数量">
</el-table-column>
<el-table-column
prop="qtyReport"
header-align="center"
align="right"
min-width="70"
label="已报工数量">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="routeModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="派工单" :close-on-click-modal="false" v-drag :visible.sync="scheduleModalFlag" width="650px">
<!-- <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">-->
<!-- <el-form-item label="工厂编码:">-->
<!-- <el-input v-model="routeDetailData.site" disabled style="width: 120px"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="日计划号:">-->
<!-- <el-input v-model="routeDetailData.orderNo" disabled style="width: 120px"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<el-table
height="300"
:data="scheduleList"
border
style="width: 100%">
<el-table-column
prop="seqNo"
header-align="center"
align="right"
min-width="50"
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="qtyRequired"
header-align="center"
align="right"
min-width="70"
label="派工数量">
</el-table-column>
<el-table-column
prop="qtyReported"
header-align="center"
align="right"
min-width="70"
label="报工数量">
</el-table-column>
<el-table-column
prop="qtyApprove"
header-align="center"
align="right"
min-width="70"
label="合格数量">
</el-table-column>
<el-table-column
prop="closedFlag"
header-align="center"
align="left"
min-width="60"
label="是否关闭">
</el-table-column>
<el-table-column
prop="circulationQty"
header-align="center"
align="left"
min-width="60"
label="流转数量">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="scheduleModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import {
getDailyPlanData,
getDailyPlanRouteDetailData,
getDailyPlanScheduleDetailData,
} from "@/api/production.js"
export default {
name: 'stockPrint',
data () {
return {
// start
exportData: [],
exportDataStandard: {
"日计划单号": "orderNo",
"计划日期": "orderDate",
"订单号": "orderRef1",
"物料编码": "partNo",
"物料名称": "partDescription",
"计划数量": "orderQty",
"已完工数": "qtyfinished",
"录入人": "userName",
"录入时间": "enterDate"
},
exportName: "日计划列表"+this.getStrDate(),
exportHeader: ["日计划列表"],
exportFooter: [],
exportDefaultValue: "这一行这一列没有数据",
// end
height:200,
tableData:[],
date1:'',
searchData:{
orderNo:'',
orderRef1:'',
partNo:'',
startDate1:new Date(),
endDate1:'',
status:'all',
site:'',
},
routeDetailData:{
site:'',
orderNo:'',
},
routeModalFlag:false,
routeList:[],
scheduleModalFlag:false,
scheduleList:[],
}
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight - 210;
})
},
methods: {
search(){
getDailyPlanData(this.searchData).then(({data}) => {
this.tableData = data.rows;
})
},
openRouteModel(row){
this.routeDetailData.site=row.site
this.routeDetailData.orderNo=row.orderNo
getDailyPlanRouteDetailData(this.routeDetailData).then(({data}) => {
this.routeList = data.rows;
})
this.routeModalFlag=true
},
openScheduleModel(row){
let inDate={
site:row.site,
orderNo:row.orderNo,//
itemNo:row.itemNo,
}
getDailyPlanScheduleDetailData(inDate).then(({data}) => {
this.scheduleList = data.rows;
})
this.scheduleModalFlag=true
},
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;
}
},
created() {
}
}
</script>
<style scoped>
</style>

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

@ -285,8 +285,11 @@
</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 :label="'本次派工单号:'">
<el-input v-model="scanSeqNo" ref="start" type="number" style="width: 130px;" @keyup.enter.native="nextSeqNo()"></el-input>
</el-form-item>
<el-form-item :label="'交接派工单号:'">
<el-input v-model="previousSeqNo" ref="last" type="number" style="width: 130px;" ></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
@ -464,6 +467,7 @@
userId:'',
},
scanSeqNo:'',
previousSeqNo:'',
stopModalFlag:false,
continueModalFlag:false,
qty1:'',
@ -683,9 +687,13 @@
},
openStart(){
this.scanSeqNo='';
this.previousSeqNo='';
this.startModalFlag=true;
this.$nextTick(() => { this.$refs.start.focus();})
},
nextSeqNo(){
this.$nextTick(() => { this.$refs.last.focus();})
},
searchSeqNo(){
if(this.scanSeqNo==''){
this.$alert("请扫描派工单!",'错误', {
@ -779,6 +787,7 @@
let inData={
username:this.$store.state.user.name,
seqNo:this.scanSeqNo,
previousSeqNo:this.previousSeqNo,
}
startSeqNo(inData).then(({data}) => {
if (data && data.code === 0) {

808
src/views/modules/schedule/scheduleForSOTask.vue

@ -0,0 +1,808 @@
<template>
<div class="mod-config">
<el-form inline="true" v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'工厂编号:'">
<el-input v-model="searchData.site" style="width: 120px"></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 :label="'生产订单号:'">
<el-input v-model="searchData.orderRef1" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'规格型号:'">
<el-input v-model="searchData.partDescription" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'计划日期:'">
<el-date-picker
style="width: 130px"
v-model="searchData.startDate1"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-top: 23px;">
<laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
</el-form-item>
<el-form-item :label="' '">
<el-date-picker
style="width: 130px"
v-model="searchData.endDate1"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
<el-form-item :label="'状态:'">
<el-select filterable v-model="searchData.status" 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 >
<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-select filterable v-model="searchData.planStatus" style="width: 120px">
<el-option label="全部" value=""></el-option>
<el-option label="未派工完" value="a.OrderQty>isnull(SL.scheduledQty,0)"></el-option>
<el-option label="已派工完" value="isnull(SL.scheduledQty,0)>= a.OrderQty"></el-option>
</el-select>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心</a></span>
<el-input v-model="searchData.workCenterNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'工序名称'">
<el-input v-model="searchData.operationDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="search()" style="margin-left: 24px" 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>
<el-table
:height="height"
:data="tableData"
:row-class-name="tableRowClassName"
border
style="width: 100%">
<el-table-column
prop=""
fixed="left"
header-align="center"
align="center"
min-width="60"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="openScheduleModel(scope.row)">派工</a>
</template>
</el-table-column>
<el-table-column
prop="site"
header-align="center"
align="left"
min-width="120"
label="工厂编号">
</el-table-column>
<el-table-column
prop="orderNo"
header-align="center"
align="left"
min-width="120"
label="日计划号">
</el-table-column>
<el-table-column
prop="itemNo"
header-align="center"
align="left"
min-width="60"
label="工序号">
</el-table-column>
<el-table-column
prop="operationDesc"
header-align="center"
align="left"
min-width="160"
label="工序名称">
</el-table-column>
<el-table-column
prop="partNo"
header-align="center"
align="left"
min-width="120"
label="物料编码">
</el-table-column>
<el-table-column
prop="partDescription"
header-align="center"
align="left"
min-width="200"
label="物料名称">
</el-table-column>
<el-table-column
prop="workCenterNo"
header-align="center"
align="left"
min-width="100"
label="加工中心">
</el-table-column>
<el-table-column
prop="workCenterDesc"
header-align="center"
align="left"
min-width="100"
label="加工中心名称">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="equipment"-->
<!-- header-align="center"-->
<!-- align="left"-->
<!-- min-width="80"-->
<!-- label="设备类型">-->
<!-- </el-table-column>-->
<el-table-column
prop="status"
header-align="center"
align="left"
min-width="60"
label="状态">
</el-table-column>
<el-table-column
prop="orderDate"
header-align="center"
align="left"
min-width="130"
label="计划日期">
</el-table-column>
<el-table-column
prop="needDate"
header-align="center"
align="left"
sortable
width="130"
label="ERP要求完工日期">
</el-table-column>
<el-table-column
prop="orderRef1"
header-align="center"
align="left"
min-width="130"
label="生产订单号">
</el-table-column>
<el-table-column
prop="lotSize"
header-align="center"
align="right"
min-width="80"
label="订单数量">
</el-table-column>
<el-table-column
prop="scheduledQty"
header-align="center"
align="right"
min-width="80"
label="已派工数量">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="qtyReported"-->
<!-- header-align="center"-->
<!-- align="right"-->
<!-- width="80"-->
<!-- label="已报工数量">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="qtyApprove"-->
<!-- header-align="center"-->
<!-- align="right"-->
<!-- width="80"-->
<!-- label="合格数量">-->
<!-- </el-table-column>-->
<el-table-column
prop="machSetupTime"
header-align="center"
align="right"
min-width="80"
label="调机时间">
</el-table-column>
<el-table-column
prop="machRunFactor"
header-align="center"
align="right"
min-width="80"
label="单位产出量">
</el-table-column>
<el-table-column
prop="factorUnit"
header-align="center"
align="left"
min-width="80"
label="产出单位">
</el-table-column>
</el-table>
<el-dialog title="派工" :close-on-click-modal="false" v-drag :visible.sync="scheduledModalFlag" width="730px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="日计划号:">
<el-input v-model="schedulingModalData.orderNo" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="工厂编号:">
<el-input v-model="schedulingModalData.site" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="计划日期:">
<el-input v-model="schedulingModalData.orderDate" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="订单数量:">
<el-input v-model="schedulingModalData.lotSize" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="待派工数:">
<el-input v-model="schedulingModalData.qtyToSchedule" disabled style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="产品编码:">
<el-input v-model="schedulingModalData.partNo" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="产品名称:">
<el-input v-model="schedulingModalData.partDescription" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="工序号:">
<el-input v-model="schedulingModalData.itemNo" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="工序名称:">
<el-input v-model="schedulingModalData.operationDesc" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="加工中心:">
<el-input v-model="schedulingModalData.workCenterNo" disabled style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="派工机台:">
<el-select v-model="schedulingModalData.resourceId" style="width: 120px"
placeholder="请选择">
<el-option v-for="item in availableResourceList " :key="index" :label="item.ResourceID+'-'+item.ResouceDesc"
:value="item.ResourceID">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="派工班次:">
<el-select v-model="schedulingModalData.shiftNo" style="width: 120px"
placeholder="请选择">
<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-select v-model="schedulingModalData.operatorId" style="width: 120px"
placeholder="请选择">
<el-option v-for="item in operatorIdList " :key="index" :label="item.operatorName"
:value="item.operatorID">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="本次累计派工数量:">
<el-input v-model="schedulingModalData.sumQty" type="number" disabled style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="派工备注:">
<el-input v-model="schedulingModalData.remark" style="width: 656px"></el-input>
</el-form-item>
</el-form>
<el-button type="primary" @click="addPlans()" style="margin-left: 10px;">添加</el-button>
<el-button type="primary" @click="saveSchedule()">保存</el-button>
<div class="rq ">
<el-table
height="200"
:data="schedulingModalTableData"
border
style="width: 100%">
<el-table-column
prop="scheduleDate"
header-align="center"
align="left"
min-width="100"
label="派工日期">
<template slot-scope="scope">
<el-date-picker
style="width: 95%"
class="sl-input"
v-model="scope.row.scheduleDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</template>
</el-table-column>
<el-table-column
prop="scheduleQty"
header-align="center"
align="right"
min-width="80"
label="派工数量">
<template slot-scope="scope">
<el-input v-model="scope.row.scheduleQty" type="number" @change="changeSum" @blur="scheduleQtyBlur(scope.row)" placeholder="请输入数量"
style="width:98%"></el-input>
</template>
</el-table-column>
<el-table-column
prop="resourceId"
header-align="center"
align="left"
min-width="80"
label="派工机台">
<template slot-scope="scope">
<el-select v-model="scope.row.resourceId" placeholder="请选择" style="height: 12px;padding: 0px " filterable
allow-create>
<el-option v-for="item in availableResourceList " :key="index" :label="item.ResourceID+'-'+item.ResouceDesc"
:value="item.ResourceID">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="shiftNo"
header-align="center"
align="left"
min-width="80"
label="派工班次">
<template slot-scope="scope">
<el-select v-model="scope.row.shiftNo" placeholder="请选择" style="height: 12px;padding: 0px " filterable
allow-create>
<el-option label="白班" value="白班"></el-option>
<el-option label="晚班" value="晚班"></el-option>
<el-option label="加班" value="加班"></el-option>
</el-select>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="shiftNo"-->
<!-- header-align="center"-->
<!-- align="left"-->
<!-- min-width="80"-->
<!-- label="派工类型">-->
<!-- <template slot-scope="scope">-->
<!-- <el-select v-model="scope.row.jobType" placeholder="请选择" style="height: 12px;padding: 0px " filterable-->
<!-- allow-create>-->
<!-- <el-option label="计件" value="计件"></el-option>-->
<!-- <el-option label="计时" value="计时"></el-option>-->
<!-- <el-option label="外协" value="外协"></el-option>-->
<!-- </el-select>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="operatorId"
header-align="center"
align="right"
min-width="80"
label="派工人员">
<template slot-scope="scope">
<el-select v-model="scope.row.operatorId" placeholder="请选择" style="height: 12px;padding: 0px " filterable
allow-create>
<el-option v-for="item in operatorIdList " :key="index" :label="item.operatorName"
:value="item.operatorID">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
width="60"
label="操作">
<template slot-scope="scope" class="foo_container">
<a type="text" size="small" @click="splitScheduleTable(scope.$index)">删除</a>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="scheduledModalFlag = false">取消</el-button>
<!-- <el-button type="primary" :disabled="bannersBut" @click="saveBanners()">确定</el-button>-->
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getSOTastRoutingData,
getWorkCenterOperatorList,
getAvailableResourceList,
scheduleForSOTask,
} from "@/api/production.js"
import Chooselist from '@/views/modules/common/Chooselist'
export default {
name: 'scheduleForSOTask',
components: {
Chooselist
},
data () {
return {
// start
exportData: [],
exportDataStandard: {
"日计划号": "orderNo",
"工序号": "itemNo",
"工序名称": "operationDesc",
"物料编码": "partNo",
"物料名称": "partDescription",
"加工中心": "workCenterNo",
"状态": "status",
"计划日期": "orderDate",
"日计划数量": "lotSize",
"已派工数量": "scheduledQty",
"生产订单号": "orderRef1",
"调机时间": "machSetupTime",
"单位产出量": "machRunFactor",
"产出单位": "factorUnit",
},
exportName: "日计划工序列表"+this.getStrDate(),
exportHeader: ["日计划工序列表"],
exportFooter: [],
exportDefaultValue: "这一行这一列没有数据",
// end
height:200,
tableData:[],
date1:'',
searchData: {
orderNo: '',
workCenterNo:'',
operationDesc:'',
startDate1: new Date(),
endDate1: '',
startDate3: '',
endDate3: '',
startDate4: '',
endDate4: '',
status: '(\'已计划\')',
partNo: '',
orderRef1:'',
site: '',
planStatus: 'a.OrderQty>isnull(SL.scheduledQty,0)',
partDescription:'',
finishFlag:'',
userId:this.$store.state.user.name,
},
schedulingModalData: {
remark:'',
orderNo: '',
site: '',
orderRef1: '',
lotSize: '',
qtyToSchedule: '',
partNo: '',
partDescription: '',
itemNo: '',
operationDesc: '',
workCenterNo: '',
scheduleDate: '',
scheduleQty: '',
resourceId: '',
shiftNo: '',
sumQty: '',
orderDate:'',
operatorId:'',
efficiency:'',
partPlanQty:'',
},
scheduledModalFlag: false,
availableResourceList: [],
schedulingModalTableData: [],
operatorIdList:[],
tagNo:'',
}
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight - 220;
})
},
methods: {
// S
getBaseList (val,type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 5) {
strVal = this.searchData.partNo
}
if (val === 24) {
strVal = this.searchData.workCenterNo
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 5) {
this.searchData.partNo = val.PartNo
}
if (this.tagNo === 24) {
this.searchData.workCenterNo = val.WorkCenterNo
}
},
search(){
getSOTastRoutingData(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;
},
openScheduleModel(row){
// if (row.lotSize-row.scheduledQty == 0) {
// this.$alert('', '', {
// confirmButtonText: ''
// })
// return false
// }
this.schedulingModalData = {
remark:'',
partPlanQty: row.partPlanQty,
orderNo: row.orderNo,
site: row.site,
orderRef1: row.orderRef1,
lotSize: row.lotSize,
qtyToSchedule: row.lotSize-row.scheduledQty,
partNo: row.partNo,
partDescription: row.partDescription,
itemNo: row.itemNo,
operationDesc: row.operationDesc,
workCenterNo: row.workCenterNo,
efficiency:row.efficiency,
orderDate: row.orderDate,
scheduleDate: '',
scheduleQty: '',
resourceId: '',
shiftNo: '',
sumQty: 0,
operatorId: '',
}
this.schedulingModalTableData = []
this.getAvailableResourceList(row);
this.getWorkCenterOperatorList(row);
this.scheduledModalFlag = true
},
addPlans () {
// if (this.schedulingModalData.resourceId == '') {
// this.$alert('', '', {
// confirmButtonText: ''
// })
// return false
// }
// if (this.schedulingModalData.shiftNo == '') {
// this.$alert('', '', {
// confirmButtonText: ''
// })
// return false
// }
let data={
scheduleQty: '',
resourceId: this.schedulingModalData.resourceId,
shiftNo: this.schedulingModalData.shiftNo,
scheduleDate: null,
operatorId:this.schedulingModalData.operatorId,
createBy:this.$store.state.user.name,
// jobType:'',
}
this.schedulingModalTableData.push(data)
this.changeSum ();
},
changeSum () {
let sum = 0
if (this.schedulingModalTableData.length > 0) {
for (let i = 0; i < this.schedulingModalTableData.length; i++) {
if (this.schedulingModalTableData[i].scheduleQty != '' && this.schedulingModalTableData[i].scheduleQty != null) {
sum += Number(this.schedulingModalTableData[i].scheduleQty)
}
}
}
this.schedulingModalData.sumQty = sum
},
splitScheduleTable (index) {
this.schedulingModalTableData.splice(index, 1)
this.changeSum()
},
getWorkCenterOperatorList(row){
let inData={
site:row.site,
workCenterNo:row.workCenterNo,
}
getWorkCenterOperatorList(inData).then(({data}) => {
this.operatorIdList = data.rows;
})
},
getAvailableResourceList(row){
let inData={
site:row.site,
orderNo:row.orderRef1,
itemNo:row.itemNo,
}
getAvailableResourceList(inData).then(({data}) => {
this.availableResourceList = data.rows;
})
},
saveSchedule(){
if(this.schedulingModalTableData.length==0){
this.$alert('请添加派工记录!', '错误', {
confirmButtonText: '确定'
})
return false
}
// if(this.schedulingModalData.qtyToSchedule<this.schedulingModalData.sumQty){
// this.$alert('', '', {
// confirmButtonText: ''
// })
// return false
// }
let flag=false;
for (let i = 0; i <this.schedulingModalTableData.length; i++) {
if(''==this.schedulingModalTableData[i].scheduleQty||this.schedulingModalTableData[i].scheduleQty==null){
this.$alert('存在派工记录没有填写派工数量!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.schedulingModalTableData[i].scheduleQty<=0){
this.$alert('派工数量必须大于0!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(''==this.schedulingModalTableData[i].resourceId||this.schedulingModalTableData[i].resourceId==null){
this.$alert('存在派工记录没有选择机台!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(''==this.schedulingModalTableData[i].shiftNo||this.schedulingModalTableData[i].shiftNo==null){
this.$alert('存在派工记录没有选择班次!', '错误', {
confirmButtonText: '确定'
})
return false
}
// if(this.schedulingModalTableData[i].jobType==''||this.schedulingModalTableData[i].jobType==null){
// this.$alert('', '', {
// confirmButtonText: ''
//
// })
// return false
// }
if(''==this.schedulingModalTableData[i].scheduleDate||this.schedulingModalTableData[i].scheduleDate==null){
this.$alert('存在派工记录没有填写日期!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(''==this.schedulingModalTableData[i].operatorId||this.schedulingModalTableData[i].operatorId==null){
this.$alert('存在派工记录没有选择操作员!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.schedulingModalTableData[i].scheduleDate!=this.schedulingModalData.orderDate){
flag=true;
}
}
if(flag){
this.$confirm(`派工日期不是排产日期,是否继续`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.doSchedule();
})
}else {
this.doSchedule();
}
},
doSchedule(){
let indata={
orderNo: this.schedulingModalData.orderNo,
site: this.schedulingModalData.site,
orderDate: this.schedulingModalData.orderDate,
partNo: this.schedulingModalData.partNo,
itemNo: this.schedulingModalData.itemNo,
workCenterNo: this.schedulingModalData.workCenterNo,
sumQty: this.schedulingModalData.sumQty,
scheduleDetail:this.schedulingModalTableData,
efficiency:this.schedulingModalData.efficiency,
orderRef1:this.schedulingModalData.orderRef1,
remark:this.schedulingModalData.remark,
}
scheduleForSOTask(indata).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModalFlag = false
for (let i = 0; i <this.tableData.length ; i++) {
if(this.tableData[i].orderNo==indata.orderNo &&this.tableData[i].itemNo==indata.itemNo){
this.tableData[i].scheduledQty=data.qty;
}
}
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
tableRowClassName ({row, rowIndex}) {
return ''
},
},
created() {
}
}
</script>
<style >
.rq .el-table .cell {
line-height: 20px;
font-size: 12px;
height: 20px;
}
.el-table .success-row {
background: #1bb61b;
}
</style>
Loading…
Cancel
Save