Browse Source

排产右键

master
rui_li 4 years ago
parent
commit
cce74ee5c1
  1. 4
      src/api/common/com_part_stock.js
  2. 918
      src/views/modules/common/com_batch_work_calendar.vue
  3. 295
      src/views/modules/common/com_part_stock.vue
  4. 158
      src/views/modules/schedule/order_schedule.vue
  5. 16
      src/views/modules/schedule/order_schedule_fqc.vue

4
src/api/common/com_part_stock.js

@ -0,0 +1,4 @@
import { createAPI } from '@/utils/httpRequest.js'
// 获取当前工单的物料库存数据
export const getOrderPartStockedQty = data => createAPI('scheduling/getOrderPartStockedQty', 'POST', data)

918
src/views/modules/common/com_batch_work_calendar.vue

@ -0,0 +1,918 @@
<template>
<div class="customer-css">
<el-dialog title="批量维护工作日历" v-drag v-bind="$attrs" v-on="$listeners" width="800px" class="customer-dialog" >
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-form-item :label="'日历编码:'">
<el-input v-model="calendarSearchData.calendarId" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'日历描述:'">
<el-input v-model="calendarSearchData.calendarDesc" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'起始时间:'">
<el-date-picker
style="width: 130px"
v-model="calendarSearchData.startDate"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'工作日类型:'">
<el-select v-model="calendarSearchData.datetype" style="width: 130px"
placeholder="请选择">
<el-option
v-for="(item, index) in selectList"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button @click="refreshModel()" type="primary" style="margin-top: 0px">{{'查询'}}</el-button>
<el-button @click="saveList()" type="primary" style="margin-top: 0px">{{'保存日历'}}</el-button>
</el-form-item>
</el-form>
<div class="calendar">
<el-table
height="400"
:data="dataList3"
border
:vertical-align="'middle'"
@selection-change="selectionChangeHandle"
style="width: 100%;"
:row-style="{height:'20px'}">
<el-table-column
v-for="(item,index) in columnList3" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
: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-column
type="selection"
align="center"
width="30px">
</el-table-column>
<el-table-column
prop="val0"
header-align="center"
align="left"
:label="this.timeArray[0]">
<template slot-scope="scope">
<el-select v-model="scope.row.val0" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
<el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="val1"
header-align="center"
align="left"
:label="this.timeArray[1]">
<template slot-scope="scope">
<el-select v-model="scope.row.val1" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
 <el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
 </el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="val2"
header-align="center"
align="left"
:label="this.timeArray[2]">
<template slot-scope="scope">
<el-select v-model="scope.row.val2" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
 <el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
 </el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="val3"
header-align="center"
align="left"
:label="this.timeArray[3]">
<template slot-scope="scope">
<el-select v-model="scope.row.val3" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
 <el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
 </el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="val4"
header-align="center"
align="left"
:label="this.timeArray[4]">
<template slot-scope="scope">
<el-select v-model="scope.row.val4" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
 <el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
 </el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="val5"
header-align="center"
align="left"
:label="this.timeArray[5]">
<template slot-scope="scope">
<el-select v-model="scope.row.val5" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
 <el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
 </el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="val6"
header-align="center"
align="left"
:label="this.timeArray[6]">
<template slot-scope="scope">
<el-select v-model="scope.row.val6" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
 <el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
 </el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="val7"
header-align="center"
align="left"
:label="this.timeArray[7]">
<template slot-scope="scope">
<el-select v-model="scope.row.val7" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
 <el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
 </el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="val8"
header-align="center"
align="left"
:label="this.timeArray[8]">
<template slot-scope="scope">
<el-select v-model="scope.row.val8" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
 <el-option v-for="item in selectList " :key="index" :label="item.label" :value="item.value">
 </el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="closeDialog">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import {
getCalendarData,
saveCalendar,
delCalendar,
calendarDatetypeInfo,
batchSaveCDData,
}from "@/api/base.js"
export default {
name: "calendar",
data () {
return {
selectList:[],
calendarModelFlag:false,
calendarModelDisableFlag:false,
newCalendarData:{
site:'',
calendarId:'',
calendarDesc:'',
status:'使用中',
id:0,
},
columnList:[
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038TableSite',
tableId: "6038Table",
tableName: "工作日类型表",
columnProp: "site",
headerAlign: "center",
align: "left",
columnLabel: "工厂编号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038TableCalendarId',
tableId: "6038Table",
tableName: "工作日类型表",
columnProp: "calendarId",
headerAlign: "center",
align: "left",
columnLabel: "日历编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038TableCalendarDesc',
tableId: "6038Table",
tableName: "工作日类型表",
columnProp: "calendarDesc",
headerAlign: "center",
align: "left",
columnLabel: "日历描述",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038TableStatus',
tableId: "6038Table",
tableName: "工作日类型表",
columnProp: "status",
headerAlign: "center",
align: "left",
columnLabel: "使用状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
],
columnList2: [
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Scheduledate',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "scheduledate",
headerAlign: "center",
align: "left",
columnLabel: "日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Datetype',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "datetype",
headerAlign: "center",
align: "left",
columnLabel: "工作日类型",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Worktime',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "worktime",
headerAlign: "center",
align: "right",
columnLabel: "累计工作时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptexacttime1',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptexacttime1",
headerAlign: "center",
align: "left",
columnLabel: "休息时间点1",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptduration1',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptduration1",
headerAlign: "center",
align: "right",
columnLabel: "休息时长1",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptexacttime2',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptexacttime2",
headerAlign: "center",
align: "left",
columnLabel: "休息时间点2",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptduration2',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptduration2",
headerAlign: "center",
align: "right",
columnLabel: "休息时长2",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptexacttime3',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptexacttime3",
headerAlign: "center",
align: "left",
columnLabel: "休息时间点3",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptduration3',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptduration3",
headerAlign: "center",
align: "right",
columnLabel: "休息时长3",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptexacttime4',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptexacttime4",
headerAlign: "center",
align: "left",
columnLabel: "休息时间点4",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptduration4',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptduration4",
headerAlign: "center",
align: "right",
columnLabel: "休息时长4",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptexacttime5',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptexacttime5",
headerAlign: "center",
align: "left",
columnLabel: "休息时间点5",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptduration5',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptduration5",
headerAlign: "center",
align: "right",
columnLabel: "休息时长5",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptexacttime6',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptexacttime6",
headerAlign: "center",
align: "left",
columnLabel: "休息时间点6",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Exceptduration6',
tableId: "6038Table2",
tableName: "工作日历表2",
columnProp: "exceptduration6",
headerAlign: "center",
align: "right",
columnLabel: "休息时长6",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
}
],
columnList3:[
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table3Site',
tableId: "6038Table3",
tableName: "工作日历表3",
columnProp: "site",
headerAlign: "center",
align: "left",
columnLabel: "工厂编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table3CalendarId',
tableId: "6038Table3",
tableName: "工作日历表3",
columnProp: "calendarId",
headerAlign: "center",
align: "left",
columnLabel: "日历编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table3CalendarDesc',
tableId: "6038Table3",
tableName: "工作日历表3",
columnProp: "calendarDesc",
headerAlign: "center",
align: "left",
columnLabel: "日历描述",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
],
maintainColumnList2:[],
height:'200',
searchData:{
site:'',
calendarId:'',
status:'使用中',
},
calendarSearchData:{
site:this.$store.state.user.site.toString(),
calendarId:'',
calendarDesc:'',
startDate:'',
endDate:'',
datetype:'',
},
dataList:[],
dataList2:[],
dataList3:[],
timeArray:[],
valueList:[],
valList:[],
dataListSelections:[],
}
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight - 150;
})
},
watch: {
'$route' (to, from) {
if(localStorage.getItem('calendar')!=undefined){
this.jump();
}
}
},
methods: {
//
init(searchData){
//
this.calendarSearchData.startDate = searchData.scheduledDate;
//
this.maintainCalendar();
},
/*刷新页面的数据*/
maintainCalendar(){
this.getSelectData();
this.calendarSearchData.calendarId = '';
this.calendarSearchData.calendarDesc ='';
//this.calendarSearchData.startDate = this.GetDateStr(0);
this.calendarSearchData.endDate = this.GetDateStr(9);
this.refreshModel();
},
jump(){
let data=JSON.parse(localStorage.getItem('calendar'));
localStorage.removeItem('calendar');
getCalendarData(data).then(({data}) => {
this.dataList = data.rows
})
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
getData(){
if(localStorage.getItem('calendar')!=undefined){
this.jump();
}else {
getCalendarData(this.searchData).then(({data}) => {
this.dataList = data.rows
})
}
},
newCalendarModel(){
this.newCalendarData.id=0,
this.newCalendarData.site=this.$store.state.user.site,
this.newCalendarData.calendarId='',
this.newCalendarData.calendarDesc='',
this.newCalendarData.status='使用中',
this.calendarModelDisableFlag=false;
this.calendarModelFlag=true;
},
editData(row){
this.newCalendarData.id=1,
this.newCalendarData.site=row.site,
this.newCalendarData.calendarId=row.calendarId,
this.newCalendarData.calendarDesc=row.calendarDesc,
this.newCalendarData.status=row.status,
this.calendarModelDisableFlag=true;
this.calendarModelFlag=true;
},
calendarSave(){
saveCalendar(this.newCalendarData).then(({data}) => {
if (data.code == 200) {
this.getData()
this.calendarModelFlag=false;
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
delData(row){
this.$confirm(`是否删除此条工作日历?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
site:row.site.toString(),
calendarId:row.calendarId,
}
delCalendar(inData).then(({data}) => {
if (data.code == 200) {
this.getData()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
refreshModel(){
this.getAll();
let mainData={
site:this.$store.state.user.site.toString(),
calendarId:this.calendarSearchData.calendarId,
calendarDesc:this.calendarSearchData.calendarDesc,
}
getCalendarData(mainData).then(({data}) => {
let list=data.rows;
if(list.length>0){
for (let i = 0; i <list.length ; i++) {
list[i].val0=this.calendarSearchData.datetype;
list[i].val1=this.calendarSearchData.datetype;
list[i].val2=this.calendarSearchData.datetype;
list[i].val3=this.calendarSearchData.datetype;
list[i].val4=this.calendarSearchData.datetype;
list[i].val5=this.calendarSearchData.datetype;
list[i].val6=this.calendarSearchData.datetype;
list[i].val7=this.calendarSearchData.datetype;
list[i].val8=this.calendarSearchData.datetype;
}
}
this.dataList3 = list;
})
},
getSelections(){
},
getSelectData () {
this.selectList = [];
let newData={
value:'',
label:'请选择',
}
this.selectList.push(newData)
let inputData={
site:this.$store.state.user.site.toString()
};
calendarDatetypeInfo(inputData).then(({data}) => {
let list = data.rows
this.calendarSearchData.datetype= list[0].datetype;
for (let i = 0; i < list.length; i++) {
let resultData = {
value: list[i].datetype,
label: list[i].datetype
}
this.selectList.push(resultData)
}
})
},
//
GetDateStr(AddDayCount) {
var dd = new Date();
dd.setDate(dd.getDate()+AddDayCount);//AddDayCount
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
return y+"-"+m+"-"+d;
},
//
getAll(){
let begin=this.calendarSearchData.startDate;
var dd = new Date(begin);
dd.setDate(dd.getDate() + 8);//AddDayCount
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 end=y+"-"+m+"-"+d;
var startNum = parseInt(begin.replace(/-/g, ''), 10);
var endNum = parseInt(end.replace(/-/g, ''), 10);
if (startNum > endNum) {
this.$alert('结束时间不能在开始时间之前!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.DateDiff(begin, end)>9){
this.$alert('时间不得相差10天!', '错误', {
confirmButtonText: '确定'
})
return false;
}
this.timeArray = [];
this.maintainColumnList2=[];
let ab = begin.split("-");
let ae = end.split("-");
let db = new Date();
db.setUTCFullYear(ab[0], ab[1]-1, ab[2]);
let de = new Date();
de.setUTCFullYear(ae[0], ae[1]-1, ae[2]);
let unixDb=db.getTime();
let unixDe=de.getTime();
for(let k=unixDb;k<=unixDe;){
this.timeArray.push(this.dateFormat(new Date(parseInt(k))));
k=k+24*60*60*1000;
}
for (let i = 0; i <this.timeArray.length ; i++) {
let property = this.timeArray[i];
let val = "val"+i;
this.maintainColumnList2.push(
{
columnProp:val,
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:property,
value:'',
}
);
}
},
dateFormat(date){
let s='';
s+=date.getFullYear()+'-'; //
s+=(date.getMonth()+1)+"-"; //
s+= date.getDate(); //
return(s); //
},
//
DateDiff(sDate1, sDate2) {
let aDate = sDate1.split("-");
let oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]); //yyyy-MM-dd
aDate = sDate2.split("-");
let oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
let iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24);
return iDays;
},
saveList() {
let inData = {
timeList: this.timeArray,
batchCDVoList: this.dataListSelections
}
batchSaveCDData(inData).then(({data}) => {
if (data && data.code == 200) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
/*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
},
},
created() {
this.getData()
}
}
</script>
<style >
.calendar .el-table .cell {
height: 27px;
}
</style>

295
src/views/modules/common/com_part_stock.vue

@ -0,0 +1,295 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
width="750px" style="height: 415px;" class="customer-dialog">
<el-form :inline="true" label-position="top" style="height: 265px;"
label-width="80px">
<!-- 菜单信息 -->
<el-row>
<el-col :span="3" >
<el-form-item :label="'工厂编码:'">
<el-input v-model="pageData.site" readonly="readonly" style="width: 80px"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item :label="'生产订单号:'">
<el-input v-model="pageData.orderNo" readonly="readonly" style="width: 120px"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="customer-button">
<el-button type="primary" @click="closeDialog" style="margin-left: 10px; margin-top: -5px;">
关闭</el-button>
</el-form-item>
</el-col>
</el-row>
<!-- 主材料 -->
<el-form>
<fieldset class="customer-fieldset" style="width: 730px; padding: 5px 0px">
<el-table height="200px"
:data="partStockList"
border
v-loading="dataListLoading"
style="width: 100%; margin-top: -5px;">
<el-table-column
v-for="(item,index) in columnPartArray" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<!--<el-input type="number" class="table-input" align="right" @blur="checkValidQty(scope.row)"-->
<el-input type="number" class="table-input" align="right" v-if="item.columnHidden"
v-model="scope.row[item.columnProp]"></el-input>
<span v-else>{{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>
</fieldset>
</el-form>
</el-form>
</el-dialog>
</div>
</template>
<script>
import {
getOrderPartStockedQty,
} from '@/api/common/com_part_stock.js';
export default {
data() {
return {
titleCon: '查看物料库存',
pageData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
orderNo: '',
itemNo: 0,
operatorId: '',
reportDate: '',
reportTime: '',
},
partStockList: [],
columnPartArray: [
{
userId: this.$store.state.user.name,
functionId: 5303,
serialNumber: '5306PartPartNo',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "partNo",
headerAlign: "center",
align: "center",
columnLabel: "物料编码",
columnWidth: 85,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5306,
serialNumber: '5306PartPartDesc',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "partDesc",
headerAlign: "center",
align: "center",
columnLabel: "物料名称",
columnWidth: 120,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5306,
serialNumber: '5306PartWarehouseId',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "warehouseId",
headerAlign: "center",
align: "center",
columnLabel: "仓库代码",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5306,
serialNumber: '5306PartWarehouseName',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "warehouseName",
headerAlign: "center",
align: "center",
columnLabel: "仓库名称",
columnWidth: 100,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5306,
serialNumber: '5306PartOnhand',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "onhand",
headerAlign: "center",
align: "center",
columnLabel: "存货量",
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5306,
serialNumber: '5306PartIsCommited',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "isCommited",
headerAlign: "center",
align: "right",
columnLabel: "已承诺",
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5306,
serialNumber: '5306PartOnOrder',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "onOrder",
headerAlign: "center",
align: "right",
columnLabel: "已订购",
columnWidth: 60,
columnHidden: true,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5306,
serialNumber: '5306PartQtyAvailable',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "qtyAvailable",
headerAlign: "center",
align: "center",
columnLabel: "可用的",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5306,
serialNumber: '5306PartQtyRequired',
tableId: "5306Part",
tableName: "物料库存",
columnProp: "qtyRequired",
headerAlign: "center",
align: "center",
columnLabel: "需求数量",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
}
],
dataListLoading: false,
}
},
methods: {
/*初始化页面参数*/
init(pageData) {
//
this.pageData.orderNo = pageData.orderNo;
this.pageData.site = pageData.site;
//
this.refreshPageTable();
},
/*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
},
//
refreshPageTable(){
getOrderPartStockedQty(this.pageData).then(({data}) => {
this.partStockList = data.rows;
});
},
},
created() {
//
}
}
</script>
<style scoped lang="scss">
/*调节页面button和input的上下间距*/
.customer-css .customer-button{
margin-top: 25px;
}
/*调节样式*/
.customer-item{
margin-top: -10px;
}
/*fieldset下table的样式*/
.customer-fieldset /deep/ .el-table__header th.is-leaf{
line-height: 16px;
}
</style>

158
src/views/modules/schedule/order_schedule.vue

@ -167,19 +167,25 @@
<el-form :inline="true" label-position="top" label-width="100px">
<el-form-item :label="'主记录'">
</el-form-item>
<el-dropdown class="customer-dropdown" size="mini" @command="handleCommand">
<el-dropdown class="customer-dropdown" size="mini" @command="OrderHandleCommand">
<el-button type="primary" @click="controlPrimaryMenuBun">
主菜单<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item class="customer-li" command="生产工单" :disabled="primaryMenuButton.shopOrderFlag">生产订单</el-dropdown-item>
<el-dropdown-item class="customer-li" command="工作日历" :disabled="primaryMenuButton.workCalendarFlag">工作日历</el-dropdown-item>
<el-dropdown-item class="customer-li" command="分批排产">分批排产</el-dropdown-item>
<el-dropdown-item class="customer-li" command="重新排产">重新排产</el-dropdown-item>
<el-dropdown-item class="customer-li" command="生产工单"
:disabled="primaryMenuButton.shopOrderFlag">生产订单</el-dropdown-item>
<el-dropdown-item class="customer-li" command="工作日历"
:disabled="primaryMenuButton.workCalendarOutFlag">工作日历</el-dropdown-item>
<el-dropdown-item class="customer-li" command="批量维护工作日历"
:disabled="primaryMenuButton.batchWorkCalendarFlag">批量维护工作日历</el-dropdown-item>
<el-dropdown-item class="customer-li" command="分批排产"
:disabled="primaryMenuButton.splitScheduleFlag">分批排产</el-dropdown-item>
<el-dropdown-item class="customer-li" command="重新排产"
:disabled="primaryMenuButton.reScheduleOrderFlag">重新排产</el-dropdown-item>
<el-dropdown-item class="customer-li" command="查看物料库存"
:disabled="primaryMenuButton.partStockFlag">查看物料库存</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-form>
<el-table
:height="height"
@ -214,6 +220,25 @@
<el-form :inline="true" label-position="top" label-width="100px">
<el-form-item :label="'明细记录'">
</el-form-item>
<el-dropdown class="customer-dropdown" size="mini" @command="OrderHandleCommand">
<el-button type="primary" @click="controlDetailMenuBun">
明细菜单<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item class="customer-li" command="生产工单"
:disabled="detailMenuButton.shopOrderFlag">生产订单</el-dropdown-item>
<el-dropdown-item class="customer-li" command="工作日历"
:disabled="detailMenuButton.workCalendarOutFlag">工作日历</el-dropdown-item>
<el-dropdown-item class="customer-li" command="批量维护工作日历"
:disabled="primaryMenuButton.batchWorkCalendarFlag">批量维护工作日历</el-dropdown-item>
<el-dropdown-item class="customer-li" command="分批排产"
:disabled="primaryMenuButton.splitScheduleFlag">分批排产</el-dropdown-item>
<el-dropdown-item class="customer-li" command="重新排产"
:disabled="primaryMenuButton.reScheduleOrderFlag">重新排产</el-dropdown-item>
<el-dropdown-item class="customer-li" command="查看物料库存"
:disabled="primaryMenuButton.partStockFlag">查看物料库存</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-form>
<el-table
:height="height"
@ -263,12 +288,14 @@
</comWorkCalendarOut>
<!-- 批量工作日历的组件 -->
<comSplitSchedule ref="comSplitSchedule" :close-on-click-modal="false"
:visible.sync="showSplitScheduleFlag"
@initAddSplitSchedule="initAddSplitSchedule">
</comSplitSchedule>
<comBatchWorkCalendar ref="comBatchWorkCalendar" :close-on-click-modal="false"
:visible.sync="showBatchWorkCalendar">
</comBatchWorkCalendar>
<!-- 物料库存查询 -->
<comPartStock ref="comPartStock" :close-on-click-modal="false"
:visible.sync="showPartStockFlag">
</comPartStock>
</div>
@ -278,6 +305,8 @@
import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/
import comSplitSchedule from '@/views/modules/schedule/com_split_schedule';/*分批排产的modal*/
import comWorkCalendarOut from "../common/com_work_calendar_out";/*工作日历外组件*/
import comBatchWorkCalendar from "../common/com_batch_work_calendar";/*批量维护工作日历外组件*/
import comPartStock from "../common/com_part_stock";/*展示物料库存的组件*/
import {
getResourceRestList,
getShopOrderList,
@ -297,8 +326,9 @@ export default {
height: 200,
tagNo: '',
showWorkCalendarOut: false,
showScheduleMenu: false,
showBatchWorkCalendar: false,
showSplitScheduleFlag: false,
showPartStockFlag: false,
scheduleIndex: -1,
modelFlag: false,
modelInputFlag: true,
@ -314,9 +344,9 @@ export default {
resourceId: '',
workCenterNo: '',
enterTime1: '',
enterTime2: new Date(),
enterTime2: this.dayjs(new Date()).format('YYYY-MM-DD'),
needTime1: '',
needTime2: new Date(),
needTime2: this.dayjs(new Date()).format('YYYY-MM-DD'),
scheduleDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
scheduleTime: '08:30',
specifiedTime: 'N',
@ -1728,9 +1758,18 @@ export default {
primaryMenuButton: {
shopOrderFlag: true,
workCalendarOutFlag: true,
closedButton: true,
pauseButton: true,
openReverseButton: true
batchWorkCalendarFlag: true,
splitScheduleFlag: true,
reScheduleOrderFlag: true,
partStockFlag: true,
},
detailMenuButton: {
shopOrderFlag: true,
workCalendarOutFlag: true,
batchWorkCalendarFlag: true,
splitScheduleFlag: true,
reScheduleOrderFlag: true,
partStockFlag: true,
}
}
},
@ -1740,6 +1779,8 @@ export default {
Chooselist,/*列表的组件*/
comSplitSchedule,/* 分批排产的组件 */
comWorkCalendarOut,/*工作日历外组件*/
comBatchWorkCalendar,/*批量维护工作日历外组件*/
comPartStock,/*展示物料库存的组件*/
},
mounted() {
@ -1821,7 +1862,7 @@ export default {
},
/*区分不同的菜单 调用不同的方法 调用不同的方法*/
handleCommand(menuName){
OrderHandleCommand(menuName){
//
if('生产工单' === menuName){
//
@ -1846,18 +1887,63 @@ export default {
'calendarDesc': this.pageData.calendarDesc, 'scheduledDate': this.pageData.scheduleDate};
//
this.$nextTick(() => {
debugger;
this.showWorkCalendarOut = true;
this.$refs.comWorkCalendarOut.init(tempData);
})
}else if('批量维护工作日历' === menuName){
//
if(this.currentRoutingRow == null || this.currentRoutingRow == {}){
//
this.primaryMenuButton.workCalendarOutFlag = true;
//
this.$message.error('请选择工单!');
return false;
}
let tempData = {'site': this.pageData.site, 'calendarId': this.pageData.calendarId,
'calendarDesc': this.pageData.calendarDesc, 'scheduledDate': this.pageData.scheduleDate};
//
this.$nextTick(() => {
this.showBatchWorkCalendar = true;
this.$refs.comBatchWorkCalendar.init(tempData);
})
}else if('分批排产' === menuName){
//
if(this.currentRoutingRow == null || this.currentRoutingRow == {}){
//
this.primaryMenuButton.workCalendarOutFlag = true;
//
this.$message.error('请选择工单!');
return false;
}
this.openSplitScheduleModal();
}else if('重新排产' === menuName){
//
if(this.currentRoutingRow == null || this.currentRoutingRow == {}){
//
this.primaryMenuButton.workCalendarOutFlag = true;
//
this.$message.error('请选择工单!');
return false;
}
//
this.warnReScheduleConfirm();
}else if('查看物料库存' === menuName){
//
if(this.currentRoutingRow == null || this.currentRoutingRow == {}){
//
this.primaryMenuButton.partStockFlag = true;
//
this.$message.error('请选择工单!');
return false;
}
let tempData = {'site': this.pageData.site, 'orderNo': this.currentRoutingRow.orderNo};
//
this.$nextTick(() => {
this.showPartStockFlag = true;
this.$refs.comPartStock.init(tempData);
})
}
},
/*打开分批排产*/
@ -2172,9 +2258,37 @@ export default {
if(this.currentRoutingRow == null || this.currentRoutingRow == {}){
this.primaryMenuButton.shopOrderFlag = true;
this.primaryMenuButton.workCalendarOutFlag = true;
this.primaryMenuButton.batchWorkCalendarFlag = true;
this.primaryMenuButton.splitScheduleFlag = true;
this.primaryMenuButton.reScheduleOrderFlag = true;
this.primaryMenuButton.partStockFlag = true;
}else{
this.primaryMenuButton.shopOrderFlag = false;
this.primaryMenuButton.workCalendarOutFlag = false;
this.primaryMenuButton.batchWorkCalendarFlag = false;
this.primaryMenuButton.splitScheduleFlag = false;
this.primaryMenuButton.reScheduleOrderFlag = false;
this.primaryMenuButton.partStockFlag = false;
}
},
/*控制明细菜单是否显示*/
controlDetailMenuBun(){
//
if(this.currentSchedlingRow == null || this.currentSchedlingRow == {}){
this.detailMenuButton.shopOrderFlag = true;
this.detailMenuButton.workCalendarOutFlag = true;
this.detailMenuButton.batchWorkCalendarFlag = true;
this.detailMenuButton.splitScheduleFlag = true;
this.detailMenuButton.reScheduleOrderFlag = true;
this.detailMenuButton.partStockFlag = true;
}else{
this.detailMenuButton.shopOrderFlag = false;
this.detailMenuButton.workCalendarOutFlag = false;
this.detailMenuButton.batchWorkCalendarFlag = false;
this.detailMenuButton.splitScheduleFlag = false;
this.detailMenuButton.reScheduleOrderFlag = false;
this.detailMenuButton.partStockFlag = false;
}
},
@ -2287,7 +2401,7 @@ div.customer-el-card-blue {
/*设置间距*/
.el-dropdown-menu /deep/ li.customer-li{
font-size: 12px;
height: 20px;
line-height: 16px;
padding: 4px 8px;
}

16
src/views/modules/schedule/order_schedule_fqc.vue

@ -318,10 +318,24 @@
</el-tabs>
</fieldset>
<!-- 工作日历外的组件 -->
<comWorkCalendarOut ref="comWorkCalendarOut" :close-on-click-modal="false"
:visible.sync="showWorkCalendarOut">
</comWorkCalendarOut>
<!-- 批量工作日历的组件 -->
<comBatchWorkCalendar ref="comBatchWorkCalendar" :close-on-click-modal="false"
:visible.sync="showBatchWorkCalendar">
</comBatchWorkCalendar>
</div>
</template>
<script>
/*组件*/
import comWorkCalendarOut from "../common/com_work_calendar_out";/*工作日历外组件*/
import comBatchWorkCalendar from "../common/com_batch_work_calendar";/*批量维护工作日历外组件*/
import {
getShopOrderListWithFqc,
getOperatorListWithFqc,
@ -344,6 +358,8 @@ export default {
activeTable: 'shop_order',
modelFlag: false,
modelInputFlag: true,
showWorkCalendarOut: false,
showBatchWorkCalendar: false,
currentRoutingRow: {},
currentOperatorRow: {},
currentScheduleRow: {},

Loading…
Cancel
Save