|
|
|
@ -1,11 +1,11 @@ |
|
|
|
<template> |
|
|
|
<div class="mod-config"> |
|
|
|
<el-form inline="true" style="margin-top: -25px;" v-model="searchData"> |
|
|
|
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;"> |
|
|
|
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;"> |
|
|
|
<el-form-item :label="'订单号:'"> |
|
|
|
<el-input v-model="searchData.orderNo" style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'计划开工日期:'" > |
|
|
|
<el-form-item :label="'计划开工日期:'"> |
|
|
|
<el-date-picker |
|
|
|
style="width: 130px" |
|
|
|
v-model="searchData.startDate2" |
|
|
|
@ -49,7 +49,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;"> |
|
|
|
<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> |
|
|
|
@ -97,14 +97,14 @@ |
|
|
|
:selectable="checkSelections" |
|
|
|
width="44"> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- width="40"--> |
|
|
|
<!-- type="selection">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-checkbox v-if="scope.row.status==1" ></el-checkbox>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- width="40"--> |
|
|
|
<!-- type="selection">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-checkbox v-if="scope.row.status==1" ></el-checkbox>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<el-table-column |
|
|
|
prop="orderNo" |
|
|
|
header-align="center" |
|
|
|
@ -183,30 +183,30 @@ |
|
|
|
min-width="30" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="openScheduleModel(scope.row)">排产</a> |
|
|
|
<a type="text" size="small" @click="openScheduleModel(scope.row)">排产</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<el-dialog title="排产信息" :visible.sync="schedulingFlag" :close-on-click-modal="false" v-drag width="800px" > |
|
|
|
<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-button @click="schedulingModal()" type="primary" style="margin-top: 33px;margin-left: 40px;">新增</el-button> |
|
|
|
</el-form> |
|
|
|
<el-dialog title="排产信息" :visible.sync="schedulingFlag" :close-on-click-modal="false" v-drag width="800px"> |
|
|
|
<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-button @click="schedulingModal()" type="primary" style="margin-top: 33px;margin-left: 40px;">新增</el-button> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
:height="300" |
|
|
|
:data="scheduleTableData" |
|
|
|
@ -261,34 +261,35 @@ |
|
|
|
min-width="50" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope" class="foo_container"> |
|
|
|
<a type="text" size="small" @click="editSchedule(scope.row)">编辑</a> |
|
|
|
<a type="text" size="small" @click="deleteSchedule(scope.row)">删除</a> |
|
|
|
<a type="text" size="small" @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-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-footer> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="维护日计划" :close-on-click-modal="false" v-drag :visible.sync="schedulingModalFlag" width="341px" > |
|
|
|
<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="选择日期"> |
|
|
|
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.shiftId" :disabled="scheduledingDataFlag1" style="width: 130px"></el-input>--> |
|
|
|
<el-select v-model="scheduledingData.shiftId" :disabled="scheduledingDataFlag1" style="width: 130px" placeholder="请选择"> |
|
|
|
<el-form-item :label="'计划班次:'"> |
|
|
|
<!-- <el-input v-model="scheduledingData.shiftId" :disabled="scheduledingDataFlag1" style="width: 130px"></el-input>--> |
|
|
|
<el-select v-model="scheduledingData.shiftId" :disabled="scheduledingDataFlag1" style="width: 130px" |
|
|
|
placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
v-for="(item,index) in selectList" |
|
|
|
:key="index" |
|
|
|
@ -299,14 +300,14 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'计划数量:'"> |
|
|
|
<el-input v-model="scheduledingData.orderQty" style="width: 130px"></el-input> |
|
|
|
<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-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> |
|
|
|
|
|
|
|
</div> |
|
|
|
@ -321,124 +322,122 @@ |
|
|
|
savePlan, |
|
|
|
getWorkPlanData, |
|
|
|
delPlan, |
|
|
|
getShiftData, |
|
|
|
} from "@/api/prd.js" |
|
|
|
getShiftData |
|
|
|
} from '@/api/prd.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'productionDispatch', |
|
|
|
data () { |
|
|
|
return { |
|
|
|
|
|
|
|
selectList:[], |
|
|
|
//维护日计划界面 |
|
|
|
schedulingModalFlag:false, |
|
|
|
scheduleTableData:[], |
|
|
|
scheduledModelData:{ |
|
|
|
orderNo:'', |
|
|
|
planStartDate:'', |
|
|
|
needDate:'', |
|
|
|
schedulingSize:'', |
|
|
|
unSchedulingSize:'', |
|
|
|
selectList: [], |
|
|
|
// 维护日计划界面 |
|
|
|
schedulingModalFlag: false, |
|
|
|
scheduleTableData: [], |
|
|
|
scheduledModelData: { |
|
|
|
orderNo: '', |
|
|
|
planStartDate: '', |
|
|
|
needDate: '', |
|
|
|
schedulingSize: '', |
|
|
|
unSchedulingSize: '' |
|
|
|
}, |
|
|
|
dataListSelections:[], |
|
|
|
scheduledingData:{ |
|
|
|
orderNo:'', |
|
|
|
orderDate:'', |
|
|
|
orderQty:'', |
|
|
|
shiftId:'', |
|
|
|
userName:this.$store.state.user.name, |
|
|
|
lotSize:'', |
|
|
|
planStartDate:'', |
|
|
|
needDate:'', |
|
|
|
site:this.$store.state.user.site, |
|
|
|
productionType:'生产订单', |
|
|
|
planAdd:0, |
|
|
|
partNo:'', |
|
|
|
dataListSelections: [], |
|
|
|
scheduledingData: { |
|
|
|
orderNo: '', |
|
|
|
orderDate: '', |
|
|
|
orderQty: '', |
|
|
|
shiftId: '', |
|
|
|
userName: this.$store.state.user.name, |
|
|
|
lotSize: '', |
|
|
|
planStartDate: '', |
|
|
|
needDate: '', |
|
|
|
site: this.$store.state.user.site, |
|
|
|
productionType: '生产订单', |
|
|
|
planAdd: 0, |
|
|
|
partNo: '' |
|
|
|
}, |
|
|
|
scheduledingDataFlag1:false, |
|
|
|
scheduledingDataFlag3:true, |
|
|
|
schedulingFlag:false , |
|
|
|
tableData:[], |
|
|
|
searchData:{ |
|
|
|
orderNo:'', |
|
|
|
scheduledingDataFlag1: false, |
|
|
|
scheduledingDataFlag3: true, |
|
|
|
schedulingFlag: false, |
|
|
|
tableData: [], |
|
|
|
searchData: { |
|
|
|
orderNo: '', |
|
|
|
startDate1: new Date(), |
|
|
|
endDate1: '', |
|
|
|
startDate2: '', |
|
|
|
endDate2: '', |
|
|
|
status: "('已下达','已发料','已入库','已开工')", |
|
|
|
partNo:'' , |
|
|
|
status: '(\'已下达\',\'已发料\',\'已入库\',\'已开工\')', |
|
|
|
partNo: '', |
|
|
|
startDate3: '', |
|
|
|
endDate3: '', |
|
|
|
site:this.$store.state.user.site , |
|
|
|
site: this.$store.state.user.site |
|
|
|
}, |
|
|
|
// table高度 |
|
|
|
height:200, |
|
|
|
height: 200 |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$nextTick(()=>{ |
|
|
|
|
|
|
|
this.height = window.innerHeight - 270; |
|
|
|
mounted () { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.height = window.innerHeight - 270 |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
search () { |
|
|
|
this.getData(); |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
//维护日计划界面 |
|
|
|
// 维护日计划界面 |
|
|
|
schedulingModal () { |
|
|
|
if(this.scheduledModelData.unSchedulingSize==0){ |
|
|
|
this.$alert("该日计划已排产完毕无需新增!", '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
return false; |
|
|
|
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.orderNo = this.scheduledModelData.orderNo; |
|
|
|
this.scheduledingData.orderDate = this.scheduledModelData.planStartDate; |
|
|
|
this.scheduledingData.planAdd = 0; |
|
|
|
this.scheduledingData.orderQty = ""; |
|
|
|
this.scheduledingData.shiftId = ""; |
|
|
|
this.schedulingModalFlag = true; |
|
|
|
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.orderNo = this.scheduledModelData.orderNo |
|
|
|
this.scheduledingData.orderDate = this.scheduledModelData.planStartDate |
|
|
|
this.scheduledingData.planAdd = 0 |
|
|
|
this.scheduledingData.orderQty = '' |
|
|
|
this.scheduledingData.shiftId = '' |
|
|
|
this.schedulingModalFlag = true |
|
|
|
}, |
|
|
|
// 多选数据 |
|
|
|
selectionChangeHandle (val) { |
|
|
|
this.dataListSelections = val; |
|
|
|
this.dataListSelections = val |
|
|
|
}, |
|
|
|
//多选框选中触发判断 |
|
|
|
checkSelections(row){ |
|
|
|
if(row.status=="已计划"||row.status=="已取消"||row.status=="已关闭"){ |
|
|
|
return false; |
|
|
|
// 多选框选中触发判断 |
|
|
|
checkSelections (row) { |
|
|
|
if (row.status == '已计划' || row.status == '已取消' || row.status == '已关闭') { |
|
|
|
return false |
|
|
|
} |
|
|
|
if(row.schedulingSize>=row.orderQty){ |
|
|
|
return false; |
|
|
|
if (row.schedulingSize >= row.orderQty) { |
|
|
|
return false |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true |
|
|
|
}, |
|
|
|
//排产信息界面 |
|
|
|
// 排产信息界面 |
|
|
|
openScheduleModel (row) { |
|
|
|
|
|
|
|
if(row.status=="已计划"||row.status=="已取消"||row.status=="已关闭"){ |
|
|
|
this.$alert("该订单状态为"+row.status+"无法排产", '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
return false; |
|
|
|
if (row.status == '已计划' || row.status == '已取消' || row.status == '已关闭') { |
|
|
|
this.$alert('该订单状态为' + row.status + '无法排产', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
let list={orderNo:row.orderNo} |
|
|
|
let list = {orderNo: row.orderNo} |
|
|
|
getSchedulingSize(list).then(({data}) => { |
|
|
|
this.scheduledModelData.schedulingSize = data.schedulingSize; |
|
|
|
this.scheduledModelData.unSchedulingSize = row.lotSize - data.schedulingSize; |
|
|
|
this.scheduledModelData.schedulingSize = data.schedulingSize |
|
|
|
this.scheduledModelData.unSchedulingSize = row.lotSize - data.schedulingSize |
|
|
|
}) |
|
|
|
this.scheduledingData.lotSize = row.lotSize; |
|
|
|
this.scheduledingData.partNo = row.partNo; |
|
|
|
this.scheduledModelData.needDate = row.needDate; |
|
|
|
this.scheduledModelData.planStartDate = row.planStartDate; |
|
|
|
this.scheduledModelData.orderNo = row.orderNo; |
|
|
|
this.schedulingFlag = true; |
|
|
|
this.scheduledingData.lotSize = row.lotSize |
|
|
|
this.scheduledingData.partNo = row.partNo |
|
|
|
this.scheduledModelData.needDate = row.needDate |
|
|
|
this.scheduledModelData.planStartDate = row.planStartDate |
|
|
|
this.scheduledModelData.orderNo = row.orderNo |
|
|
|
this.schedulingFlag = true |
|
|
|
let data1 = {orderNo: row.orderNo} |
|
|
|
getWorkPlanData(data1).then(({data}) => { |
|
|
|
this.scheduleTableData = data.rows |
|
|
|
@ -447,133 +446,129 @@ |
|
|
|
|
|
|
|
// 查询 |
|
|
|
getData () { |
|
|
|
|
|
|
|
|
|
|
|
getShopOrderData(JSON.parse(JSON.stringify(this.searchData))).then(({data}) => { |
|
|
|
this.tableData = data.rows; |
|
|
|
this.tableData = data.rows |
|
|
|
}) |
|
|
|
}, |
|
|
|
planSave () { |
|
|
|
|
|
|
|
if (this.scheduledingData.orderDate == "" || null == this.scheduledingData.orderDate) { |
|
|
|
this.$alert("请选择计划日期!", '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
return false; |
|
|
|
if (this.scheduledingData.orderDate == '' || this.scheduledingData.orderDate == null) { |
|
|
|
this.$alert('请选择计划日期!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.scheduledingData.orderQty == "" || null == this.scheduledingData.orderQty) { |
|
|
|
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; |
|
|
|
if (this.scheduledingData.orderQty <= 0) { |
|
|
|
this.$alert('排产数量必须大于0!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.scheduledingData.shiftId == "") { |
|
|
|
this.$alert("请输入排产班次!", '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
return false; |
|
|
|
if (this.scheduledingData.shiftId == '') { |
|
|
|
this.$alert('请输入排产班次!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
// this.scheduledingData.orderDate = this.format(this.scheduledingData.orderDate,'yyyy-MM-dd') |
|
|
|
// this.scheduledingData.orderDate = this.format(this.scheduledingData.orderDate,'yyyy-MM-dd') |
|
|
|
|
|
|
|
savePlan(this.scheduledingData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.scheduledModelData.schedulingSize = data.schedulingSize |
|
|
|
this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize |
|
|
|
this.schedulingModalFlag = false |
|
|
|
let data1 = {orderNo: this.scheduledModelData.orderNo} |
|
|
|
getWorkPlanData(data1).then(({data}) => { |
|
|
|
this.scheduleTableData = data.rows |
|
|
|
}) |
|
|
|
this.getData() |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
|
|
|
|
savePlan(this.scheduledingData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.scheduledModelData.schedulingSize = data.schedulingSize; |
|
|
|
this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize; |
|
|
|
this.schedulingModalFlag = false; |
|
|
|
let data1 = {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: '确定', |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
onClose: () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
planSaveOn () { |
|
|
|
if (this.scheduledingData.orderDate == "" || null == this.scheduledingData.orderDate) { |
|
|
|
this.$alert("请选择计划日期!", '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
return false; |
|
|
|
if (this.scheduledingData.orderDate == '' || this.scheduledingData.orderDate == null) { |
|
|
|
this.$alert('请选择计划日期!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.scheduledingData.orderQty == "" || null == this.scheduledingData.orderQty) { |
|
|
|
this.$alert("请输入排产数量!", '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
return false; |
|
|
|
if (this.scheduledingData.orderQty == '' || this.scheduledingData.orderQty == null) { |
|
|
|
this.$alert('请输入排产数量!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.scheduledingData.shiftId == "") { |
|
|
|
this.$alert("请输入排产班次!", '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
return false; |
|
|
|
if (this.scheduledingData.shiftId == '') { |
|
|
|
this.$alert('请输入排产班次!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.scheduledingData.orderQty <= 0 ) { |
|
|
|
this.$alert("排产数量必须大于0!", '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
return false; |
|
|
|
if (this.scheduledingData.orderQty <= 0) { |
|
|
|
this.$alert('排产数量必须大于0!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
savePlan(this.scheduledingData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
getShiftData().then(({data}) => { |
|
|
|
this.shiftData = data.rows; |
|
|
|
}) |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
savePlan(this.scheduledingData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
getShiftData().then(({data}) => { |
|
|
|
this.shiftData = data.rows |
|
|
|
}) |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
|
|
|
|
onClose: () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
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.orderDate = row.orderDate; |
|
|
|
this.scheduledingData.planAdd = 1; |
|
|
|
this.scheduledingData.orderQty = row.orderQty; |
|
|
|
this.scheduledingData.shiftId = row.shiftId; |
|
|
|
this.schedulingModalFlag = true; |
|
|
|
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.orderDate = row.orderDate |
|
|
|
this.scheduledingData.planAdd = 1 |
|
|
|
this.scheduledingData.orderQty = row.orderQty |
|
|
|
this.scheduledingData.shiftId = row.shiftId |
|
|
|
this.schedulingModalFlag = true |
|
|
|
}, |
|
|
|
//刪除 |
|
|
|
// 刪除 |
|
|
|
deleteSchedule (row) { |
|
|
|
let delData = { |
|
|
|
orderNo: row.orderNo, |
|
|
|
orderQty: row.orderQty, |
|
|
|
orderRef1: row.orderRef1, |
|
|
|
orderRef1: row.orderRef1 |
|
|
|
} |
|
|
|
this.$confirm(`是否删除此条记录?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
@ -582,9 +577,9 @@ |
|
|
|
}).then(() => { |
|
|
|
delPlan(delData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.scheduledModelData.schedulingSize = data.schedulingSize; |
|
|
|
this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize; |
|
|
|
this.getData(); |
|
|
|
this.scheduledModelData.schedulingSize = data.schedulingSize |
|
|
|
this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize |
|
|
|
this.getData() |
|
|
|
let data1 = {orderNo: this.scheduledModelData.orderNo} |
|
|
|
getWorkPlanData(data1).then(({data}) => { |
|
|
|
this.scheduleTableData = data.rows |
|
|
|
@ -598,41 +593,39 @@ |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
}); |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getTime(date) { |
|
|
|
if(date==''){ |
|
|
|
return "" |
|
|
|
}else{ |
|
|
|
let json_date = new Date(date).toJSON(); |
|
|
|
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/, '') |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getSelectData(){ |
|
|
|
this.selectList=[]; |
|
|
|
getSelectData () { |
|
|
|
this.selectList = [] |
|
|
|
getShiftData().then(({data}) => { |
|
|
|
let list=data.rows; |
|
|
|
for (let i = 0; i <list.length ; i++) { |
|
|
|
let list = data.rows |
|
|
|
for (let i = 0; i < list.length; i++) { |
|
|
|
let resultData = { |
|
|
|
value:list[i].id, |
|
|
|
label:list[i].shiftdesc |
|
|
|
value: list[i].id, |
|
|
|
label: list[i].shiftdesc |
|
|
|
} |
|
|
|
this.selectList.push(resultData); |
|
|
|
this.selectList.push(resultData) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getSelectData(); |
|
|
|
created () { |
|
|
|
this.getSelectData() |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|