Browse Source

0927 阮琦 日历系统

master
ruanqi 4 years ago
parent
commit
b0bf7b5b5a
  1. BIN
      dist.7z
  2. 34
      src/api/base.js
  3. 29
      src/views/demo/null.vue
  4. 2
      src/views/main-navbar-update-language.vue
  5. 797
      src/views/modules/base/calendar.vue
  6. 731
      src/views/modules/base/calendarDatetype.vue
  7. 14
      src/views/modules/productionOrder/searchOrderToBeProduced.vue
  8. 2
      src/views/modules/purchaseorder/procurementReview.vue

BIN
dist.7z

34
src/api/base.js

@ -0,0 +1,34 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取工作日类型列表
export const calendarDatetypeInfo = data => createAPI(`/base/calendarDatetypeInfo`,'post',data)
export const saveCalendarDatetypeData = data => createAPI(`/base/saveCalendarDatetypeData`,'post',data)
export const delCalendarType = data => createAPI(`/base/delCalendarType`,'post',data)
export const getShiftData = data => createAPI(`/base/getShiftData`,'post',data)
export const saveShift = data => createAPI(`/base/saveShift`,'post',data)
export const updateShift = data => createAPI(`/base/updateShift`,'post',data)
export const delShift = data => createAPI(`/base/delShift`,'post',data)
export const getCalendarData = data => createAPI(`/base/getCalendarData`,'post',data)
export const saveCalendar = data => createAPI(`/base/saveCalendar`,'post',data)
export const delCalendar = data => createAPI(`/base/delCalendar`,'post',data)
export const getCalendarExceptionData = data => createAPI(`/base/getCalendarExceptionData`,'post',data)
export const batchSaveCDData = data => createAPI(`/base/batchSaveCDData`,'post',data)

29
src/views/demo/null.vue

@ -0,0 +1,29 @@
<template>
</template>
<script>
import {} from "@/api/sysLanguage.js"
export default {
name: "null",
data() {
return {
height: '',
}
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 240;
})
},
methods: {},
created() {
}
}
</script>
<style scoped>
</style>

2
src/views/main-navbar-update-language.vue

@ -27,7 +27,7 @@
<script>
import {updateUserLanguage} from '@/api/user.js'
import PubSub from 'pubsub-js'
// import PubSub from 'pubsub-js'
export default {
data() {

797
src/views/modules/base/calendar.vue

@ -0,0 +1,797 @@
<template>
<div class="mod-config">
<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: 130px"></el-input>
</el-form-item>
<el-form-item :label="'日历编码:'">
<el-input v-model="searchData.calendarId" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'状态:'">
<el-select filterable v-model="searchData.status" style="width: 80px">
<el-option label="全部" value=""></el-option>
<el-option label="使用中" value="使用中"></el-option>
<el-option label="停用" value="停用"></el-option>
</el-select>
</el-form-item>
<el-button @click="getData()" type="primary" style="margin-left: 2px;margin-top: 33px">{{'查询'}}</el-button>
<el-button @click="newCalendarModel()" type="primary" style="margin-top: 33px">{{'新增工作日历'}}</el-button>
<el-button @click="maintainCalendar()" type="primary" style="margin-top: 33px">{{'批量维护工作日历'}}</el-button>
</el-form>
<el-table
:height="height"
:data="dataList"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:prop="item.columnProp"
:header-align="item.headerAlign"
:align="item.align"
:min-width="item.width"
:label="item.columnLabel">
</el-table-column>
<el-table-column
header-align="center"
align="center"
min-width="70"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="editData(scope.row)">编辑</a>
<a type="text" size="small" @click="getCEModel(scope.row)">工作日历例外</a>
<a type="text" size="small" @click="delData(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<el-dialog title="维护工作日历" :close-on-click-modal="false" v-drag :visible.sync="calendarModelFlag" width="341px" >
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'工厂编号:'">
<el-input v-model="newCalendarData.site" :disabled="calendarModelDisableFlag" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'日历编号:'">
<el-input v-model="newCalendarData.calendarId" :disabled="calendarModelDisableFlag" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'日历描述:'">
<el-input v-model="newCalendarData.calendarDesc" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'状态:'">
<el-select filterable v-model="newCalendarData.status" style="width: 130px">
<el-option label="使用中" value="使用中"></el-option>
<el-option label="停用" value="停用"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="calendarSave()">保存</el-button>
<el-button type="primary" @click="calendarModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="工作日历例外" :close-on-click-modal="false" v-drag :visible.sync="CEFlag" width="1200px" >
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-form-item :label="'工厂编号:'">
<el-input v-model="CESearchData.site" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'日历编码:'">
<el-input v-model="CESearchData.calendarId" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'日历描述:'">
<el-input v-model="CESearchData.calendarDesc" style="width: 130px"></el-input>
</el-form-item>
</el-form>
<el-table
height="400"
:data="dataList2"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList2" :key="index"
:prop="item.columnProp"
:header-align="item.headerAlign"
:align="item.align"
:min-width="item.width"
:label="item.columnLabel">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="CEFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="批量维护工作日历" :close-on-click-modal="false" v-drag :visible.sync="maintainCalendarFlag" width="1200px" >
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-form-item :label="'日历编码:'">
<el-input v-model="maintainCalendarSearchData.calendarId" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'日历描述:'">
<el-input v-model="maintainCalendarSearchData.calendarDesc" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'起始时间:'">
<el-date-picker
style="width: 130px"
v-model="maintainCalendarSearchData.startDate"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<!-- <el-form-item :label="'至:'">-->
<!-- <el-date-picker-->
<!-- style="width: 130px"-->
<!-- v-model="maintainCalendarSearchData.endDate"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="选择日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item :label="'工作日类型:'">
<el-select v-model="maintainCalendarSearchData.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-form-item>
<el-form-item>
<el-button @click="refreshModel()" type="primary" style="margin-top: 33px">{{'查询'}}</el-button>
<el-button @click="saveList()" type="primary" style="margin-top: 33px">{{'保存日历'}}</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 maintainColumnList1" :key="index"
:prop="item.columnProp"
:header-align="item.headerAlign"
:align="item.align"
:vertical-align="'middle'"
:min-width="item.width"
:label="item.columnLabel">
</el-table-column>
<el-table-column
type="selection"
align="center"
width="30px">
</el-table-column>
<!-- <el-table-column-->
<!-- v-for="(item,index) in maintainColumnList2" :key="index"-->
<!-- :prop="item.columnProp"-->
<!-- :header-align="item.headerAlign"-->
<!-- :align="item.align"-->
<!-- :min-width="item.width"-->
<!-- :vertical-align="'middle'"-->
<!-- :label="item.columnLabel"-->
<!-- :formatter="getSelections">-->
<!-- <template slot-scope="scope">-->
<!-- <el-select v-model="item.columnProp" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>-->
<!--  <el-option v-for="item2 in selectList " :key="index" :label="item2.label" :value="item2.value">-->
<!--  </el-option>-->
<!-- </el-select>-->
<!-- </template>-->
<!-- </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>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="maintainCalendarFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import {
getCalendarData,
saveCalendar,
delCalendar,
getCalendarExceptionData,
calendarDatetypeInfo,
batchSaveCDData,
}from "@/api/base.js"
export default {
name: "calendar",
data () {
return {
selectList:[],
calendarModelFlag:false,
calendarModelDisableFlag:false,
maintainCalendarFlag:false,
CEFlag:false,
newCalendarData:{
site:'',
calendarId:'',
calendarDesc:'',
status:'使用中',
id:0,
},
columnList:[
{
columnProp:'site',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'工厂编号',
},
{
columnProp:'calendarId',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'日历编码',
},
{
columnProp:'calendarDesc',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'日历描述',
},
{
columnProp:'status',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'使用状态',
},
// {
// columnProp:'site',
// headerAlign:'center',
// align:'left',
// width:'50',
// columnLabel:'',
// }
],
columnList2: [
{
columnProp:'scheduledate',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'日期',
},
{
columnProp:'datetype',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'工作日类型',
},
{
columnProp:'worktime',
headerAlign:'center',
align:'right',
width:'100px',
columnLabel:'累计工作时间',
},
{
columnProp:'exceptexacttime1',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'休息时间点1',
},
{
columnProp:'exceptduration1',
headerAlign:'center',
align:'right',
width:'100px',
columnLabel:'休息时长1',
},
{
columnProp:'exceptexacttime2',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'休息时间点2',
},
{
columnProp:'exceptduration2',
headerAlign:'center',
align:'right',
width:'100px',
columnLabel:'休息时长2',
},
{
columnProp:'exceptexacttime3',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'休息时间点3',
},
{
columnProp:'exceptduration3',
headerAlign:'center',
align:'right',
width:'100px',
columnLabel:'休息时长3',
},
{
columnProp:'exceptexacttime4',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'休息时间点4',
},
{
columnProp:'exceptduration4',
headerAlign:'center',
align:'right',
width:'100px',
columnLabel:'休息时长4',
},
{
columnProp:'exceptexacttime5',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'休息时间点5',
},
{
columnProp:'exceptduration5',
headerAlign:'center',
align:'right',
width:'100px',
columnLabel:'休息时长5',
},
{
columnProp:'exceptexacttime6',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'休息时间点6',
},
{
columnProp:'exceptduration6',
headerAlign:'center',
align:'right',
width:'100px',
columnLabel:'休息时长6',
}
],
maintainColumnList1:[
{
columnProp:'site',
headerAlign:'center',
align:'left',
width:'80px',
columnLabel:'工厂编码',
},
{
columnProp:'calendarId',
headerAlign:'center',
align:'left',
width:'80px',
columnLabel:'日历编码',
},
{
columnProp:'calendarDesc',
headerAlign:'center',
align:'left',
width:'100px',
columnLabel:'日历描述',
},
],
maintainColumnList2:[],
height:'200',
searchData:{
site:'',
calendarId:'',
status:'使用中',
},
CESearchData:{
site:'',
calendarId:'',
calendarDesc:'',
},
maintainCalendarSearchData:{
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 - 190;
})
},
methods: {
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
getData(){
getCalendarData(this.searchData).then(({data}) => {
this.dataList = data.rows
})
},
newCalendarModel(){
this.newCalendarData.id=0,
this.newCalendarData.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: '确定'
})
}
})
})
},
getCEModel(row){
this.CESearchData.site=row.site;
this.CESearchData.calendarDesc=row.calendarDesc;
this.CESearchData.calendarId=row.calendarId;
this.CEFlag=true;
getCalendarExceptionData(this.CESearchData).then(({data}) => {
this.dataList2 = data.rows
})
},
maintainCalendar(){
this.getSelectData();
this.maintainCalendarSearchData.calendarId='';
this.maintainCalendarSearchData.calendarDesc='';
this.maintainCalendarSearchData.startDate= this.GetDateStr(0);
this.maintainCalendarSearchData.endDate=this.GetDateStr(7);
this.refreshModel();
this.maintainCalendarFlag=true;
},
refreshModel(){
this.getAll();
let mainData={
site:this.$store.state.user.site.toString(),
calendarId:this.maintainCalendarSearchData.calendarId,
calendarDesc:this.maintainCalendarSearchData.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.maintainCalendarSearchData.datetype;
list[i].val1=this.maintainCalendarSearchData.datetype;
list[i].val2=this.maintainCalendarSearchData.datetype;
list[i].val3=this.maintainCalendarSearchData.datetype;
list[i].val4=this.maintainCalendarSearchData.datetype;
list[i].val5=this.maintainCalendarSearchData.datetype;
list[i].val6=this.maintainCalendarSearchData.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.maintainCalendarSearchData.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.maintainCalendarSearchData.startDate;
var dd = new Date(begin);
dd.setDate(dd.getDate()+6);//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:'',
}
);
}
},
// getAll(){
// let begin=this.maintainCalendarSearchData.startDate;
// let end=this.maintainCalendarSearchData.endDate;
// 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.maintainCalendarFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
created() {
this.getData()
}
}
</script>
<style >
.calendar .el-table .cell {
height: 28px;
}
</style>

731
src/views/modules/base/calendarDatetype.vue

@ -0,0 +1,731 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
<el-form-item>
<el-button @click="newData()" type="primary" style="margin-left: 2px">{{buttons.newData}}</el-button>
<el-button @click="searchList()" type="primary">{{buttons.searchList}}</el-button>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
border
style="width: 100%;">
<el-table-column
header-align="center"
align="center"
min-width="70"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="editData(scope.row)">编辑</a>
<a type="text" size="small" @click="delData(scope.row)">删除</a>
<a type="text" size="small" @click="shiftModal(scope.row)">班次信息</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:prop="item.columnProp"
:header-align="item.headerAlign"
:align="item.align"
:min-width="item.width"
:label="item.columnLabel">
</el-table-column>
</el-table>
<el-dialog title="维护工作日类型" :close-on-click-modal="false" v-drag :visible.sync="newDateTypeFlag" width="341px" >
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="工厂编号">
<el-input v-model="dateTypeList.site" :disabled="true" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'工作日类型:'">
<el-input v-model="dateTypeList.datetype" :disabled="newDateTypeChangeFlag" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点1:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="dateTypeList.exceptexacttime1"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长1:'">
<el-input v-model="dateTypeList.exceptduration1" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点2:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="dateTypeList.exceptexacttime2"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长2:'">
<el-input v-model="dateTypeList.exceptduration2" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点3:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="dateTypeList.exceptexacttime3"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长3:'">
<el-input v-model="dateTypeList.exceptduration3" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点4:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="dateTypeList.exceptexacttime4"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长4:'">
<el-input v-model="dateTypeList.exceptduration4" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点5:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="dateTypeList.exceptexacttime5"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长5:'">
<el-input v-model="dateTypeList.exceptduration5" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点6:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="dateTypeList.exceptexacttime6"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长6:'">
<el-input v-model="dateTypeList.exceptduration6" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'备注:'">
<el-input v-model="dateTypeList.remark" style="width: 275px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="calendarDatetypeSave()">保存</el-button>
<el-button type="primary" @click="newDateTypeFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="班次信息" :close-on-click-modal="false" v-drag :visible.sync="shiftFlag" width="600px" >
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-button type="primary" @click="newShift()">新增班次</el-button>
</el-form>
<el-table
:height="height2"
:data="shiftList"
border
style="width: 100%">
<el-table-column
prop="shiftno"
header-align="center"
align="left"
label="班次编码">
</el-table-column>
<el-table-column
prop="shiftdesc"
header-align="center"
align="left"
label="班次名称">
</el-table-column>
<el-table-column
prop="startexacttime"
header-align="center"
align="left"
label="上班时间">
</el-table-column>
<el-table-column
prop="endexacttime"
header-align="center"
align="left"
label="下班时间">
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="editShift(scope.row)">编辑</a>
<a type="text" size="small" @click="deleteShift(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="shiftFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="维护班次" :close-on-click-modal="false" v-drag :visible.sync="newShiftFlag" width="341px" >
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'班次编码:'">
<el-input v-model="newShiftData.shiftno" :disabled="newShiftFlag1" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'班次名称:'">
<el-input v-model="newShiftData.shiftdesc" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'上班时间:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="newShiftData.startexacttime"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'下班时间:'" >
<el-time-picker
arrow-control
format="HH:mm"
style="width: 130px"
v-model="newShiftData.endexacttime"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="newShiftSave()">保存</el-button>
<el-button type="primary" @click="newShiftFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import {
calendarDatetypeInfo,
saveCalendarDatetypeData,
delCalendarType,
getShiftData,
saveShift,
updateShift,
delShift,
}from "@/api/base.js"
export default {
name: "calendarDatetype",
data () {
return {
// table
height:450,
height2:300,
newDateTypeFlag: false,
newDateTypeChangeFlag: false,
shiftFlag:false,
newShiftFlag: false,
newShiftFlag1:false,
buttons: {
newData: '新增工作日类型',
searchList:'查询',
},
newShiftData:{
shiftno:'',
shiftdesc:'',
startexacttime:'',
endexacttime:'',
datetype:'',
id:'',
site:this.$store.state.user.site.toString(),
},
shiftSearchData:{
site:'',
datetype:'',
},
//
dataList: [],
shiftList:[],
columnList: [
{
columnProp:'datetype',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'工作日类型',
},
{
columnProp:'exceptexacttime1',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'休息时间点1',
},
{
columnProp:'exceptduration1',
headerAlign:'center',
align:'right',
width:'50',
columnLabel:'休息时长1',
},
{
columnProp:'exceptexacttime2',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'休息时间点2',
},
{
columnProp:'exceptduration2',
headerAlign:'center',
align:'right',
width:'50',
columnLabel:'休息时长2',
},
{
columnProp:'exceptexacttime3',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'休息时间点3',
},
{
columnProp:'exceptduration3',
headerAlign:'center',
align:'right',
width:'50',
columnLabel:'休息时长3',
},
{
columnProp:'exceptexacttime4',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'休息时间点4',
},
{
columnProp:'exceptduration4',
headerAlign:'center',
align:'right',
width:'50',
columnLabel:'休息时长4',
},
{
columnProp:'exceptexacttime5',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'休息时间点5',
},
{
columnProp:'exceptduration5',
headerAlign:'center',
align:'right',
width:'50',
columnLabel:'休息时长5',
},
{
columnProp:'exceptexacttime6',
headerAlign:'center',
align:'left',
width:'50',
columnLabel:'休息时间点6',
},
{
columnProp:'exceptduration6',
headerAlign:'center',
align:'right',
width:'50',
columnLabel:'休息时长6',
},
{
columnProp:'worktime',
headerAlign:'center',
align:'right',
width:'50',
columnLabel:'累计工作时间',
}
],
dateTypeList: {
site: '',
datetype: '',
exceptexacttime1: '',
exceptduration1: '',
exceptexacttime2: '',
exceptduration2: '',
exceptexacttime3: '',
exceptduration3: '',
exceptexacttime4: '',
exceptduration4: '',
exceptexacttime5: '',
exceptduration5: '',
exceptexacttime6: '',
exceptduration6: '',
remark: '',
id: '',
},
}
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight - 180;
})
},
methods: {
searchList(){
let list = {site: this.$store.state.user.site.toString()}
calendarDatetypeInfo(list).then(({data}) => {
this.dataList = data.rows
})
},
//
newData(){
this.dateTypeList.site=this.$store.state.user.site.toString();
this.dateTypeList.datetype='';
this.dateTypeList.exceptexacttime1='';
this.dateTypeList.exceptduration1='';
this.dateTypeList.exceptexacttime2='';
this.dateTypeList.exceptduration2='';
this.dateTypeList.exceptexacttime3='';
this.dateTypeList.exceptduration3='';
this.dateTypeList.exceptexacttime4='';
this.dateTypeList.exceptduration4='';
this.dateTypeList.exceptexacttime5='';
this.dateTypeList.exceptduration5='';
this.dateTypeList.exceptexacttime6='';
this.dateTypeList.exceptduration6='';
this.dateTypeList.id=0;
this.newDateTypeChangeFlag=false;
this.newDateTypeFlag=true;
},
//
calendarDatetypeSave(){
if (this.dateTypeList.exceptexacttime1=="") {
this.$alert('请输入休息时间点1!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if (this.dateTypeList.exceptduration1=="") {
this.$alert('请输入休息时长1!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if ((this.dateTypeList.exceptexacttime2==""||this.dateTypeList.exceptexacttime2==null)^this.dateTypeList.exceptduration2=="") {
this.$alert('请将休息时间点2或休息时长2填完整!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if ((this.dateTypeList.exceptexacttime3==""||this.dateTypeList.exceptexacttime3==null)^this.dateTypeList.exceptduration3=="") {
this.$alert('请将休息时间点3或休息时长3填完整!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if ((this.dateTypeList.exceptexacttime4==""||this.dateTypeList.exceptexacttime4==null)^this.dateTypeList.exceptduration4=="") {
this.$alert('请将休息时间点4或休息时长4填完整!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if ((this.dateTypeList.exceptexacttime5==""||this.dateTypeList.exceptexacttime5==null)^this.dateTypeList.exceptduration5=="") {
this.$alert('请将休息时间点5或休息时长5填完整!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if ((this.dateTypeList.exceptexacttime6==""||this.dateTypeList.exceptexacttime6==null)^this.dateTypeList.exceptduration6=="") {
this.$alert('请将休息时间点6或休息时长6填完整!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if (this.dateTypeList.datetype=="") {
this.$alert('请输入工作日类型!', '错误', {
confirmButtonText: '确定'
})
return false;
}
//
var bln = false;
var list = new Array();
list.push(this.dateTypeList.exceptexacttime1);
list.push(this.dateTypeList.exceptduration1);
list.push(this.dateTypeList.exceptexacttime2);
list.push(this.dateTypeList.exceptduration2);
list.push(this.dateTypeList.exceptexacttime3);
list.push(this.dateTypeList.exceptduration3);
list.push(this.dateTypeList.exceptexacttime4);
list.push(this.dateTypeList.exceptduration4);
list.push(this.dateTypeList.exceptexacttime5);
list.push(this.dateTypeList.exceptduration5);
list.push(this.dateTypeList.exceptexacttime6);
list.push(this.dateTypeList.exceptduration6);
for(var i = 0 ; i < list.length; i++){
if(list[i]!=""){
bln=true;
break;
}
}
if(bln==true){
for(var i = 11 ; i >= 0 ; i--) {
if(list[i]!=""){
if(i!=0){
if(list[i-1]==""){
this.$alert('请按照顺序输入!', '错误', {
confirmButtonText: '确定'
})
return false;
}
}
}
}
}
/**
* 保存数据
*/
saveCalendarDatetypeData(this.dateTypeList).then(({data}) => {
if (data.code == 200) {
this.searchList();
this.newDateTypeFlag=false;
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
editData(row){
this.dateTypeList.site= row.site;
this.dateTypeList.datetype= row.datetype;
this.dateTypeList.exceptexacttime1 = row.exceptexacttime1;
this.dateTypeList.exceptduration1 = row.exceptduration1;
if(row.exceptduration2!=0) {
this.dateTypeList.exceptexacttime2 = row.exceptexacttime2;
this.dateTypeList.exceptduration2 = row.exceptduration2;
}else{
this.dateTypeList.exceptexacttime2 = '';
this.dateTypeList.exceptduration2 = '';
}
if(row.exceptduration3!=0) {
this.dateTypeList.exceptexacttime3 = row.exceptexacttime3;
this.dateTypeList.exceptduration3 = row.exceptduration3;
}else{
this.dateTypeList.exceptexacttime3 = '';
this.dateTypeList.exceptduration3 = '';
}
if(row.exceptduration4!=0) {
this.dateTypeList.exceptexacttime4 = row.exceptexacttime4;
this.dateTypeList.exceptduration4 = row.exceptduration4;
}else{
this.dateTypeList.exceptexacttime4 = '';
this.dateTypeList.exceptduration4 = '';
}
if(row.exceptduration5!=0) {
this.dateTypeList.exceptexacttime5 = row.exceptexacttime5;
this.dateTypeList.exceptduration5 = row.exceptduration5;
}else{
this.dateTypeList.exceptexacttime5 = '';
this.dateTypeList.exceptduration5 = '';
}
if(row.exceptduration6!=0) {
this.dateTypeList.exceptexacttime6 = row.exceptexacttime6;
this.dateTypeList.exceptduration6 = row.exceptduration6;
}else{
this.dateTypeList.exceptexacttime6 = '';
this.dateTypeList.exceptduration6 = '';
}
this.dateTypeList.remark= row.remark;
this.dateTypeList.id= 1;
this.newDateTypeChangeFlag=true;
this.newDateTypeFlag=true;
},
delData(row){
this.$confirm(`是否删除此条工作日类型?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
site:row.site.toString(),
datetype:row.datetype,
}
delCalendarType(inData).then(({data}) => {
if (data.code == 200) {
this.searchList();
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
shiftModal(row){
this.shiftFlag=true;
this.shiftSearchData.site=row.site;
this.shiftSearchData.datetype=row.datetype;
this.newShiftData.datetype=row.datetype;
this.searchShift();
},
newShift(){
this.newShiftFlag1 = false
this.newShiftData.shiftno = ''
this.newShiftData.shiftdesc = ''
this.newShiftData.startexacttime = ''
this.newShiftData.endexacttime = ''
this.newShiftData.id = 0
this.newShiftFlag=true;
},
searchShift(){
getShiftData(this.shiftSearchData).then(({data}) => {
this.shiftList = data.rows
})
},
editShift (row) {
this.newShiftData.shiftno = row.shiftno
this.newShiftData.shiftdesc = row.shiftdesc
this.newShiftData.startexacttime = row.startexacttime
this.newShiftData.endexacttime = row.endexacttime
this.newShiftData.id =2
this.newShiftFlag1 = true
this.newShiftFlag = true
},
newShiftSave () {
if (this.newShiftData.shiftno == '' || this.newShiftData.shiftno == null) {
this.$alert('请输入班次编码!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.newShiftData.shiftdesc == '' || this.newShiftData.shiftdesc == null) {
this.$alert('请输入班次名称!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.newShiftData.startexacttime == '') {
this.$alert('请输入上班时间!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.newShiftData.endexacttime == '') {
this.$alert('请输入下班时间!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.newShiftData.id===0) {
saveShift(this.newShiftData).then(({data}) => {
if (data && data.code == 200) {
this.newShiftFlag = false
getShiftData(this.shiftSearchData).then(({data}) => {
this.shiftList = data.rows
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}else{
updateShift(this.newShiftData).then(({data}) => {
if (data && data.code == 200) {
this.newShiftFlag = false
getShiftData(this.shiftSearchData).then(({data}) => {
this.shiftList = data.rows
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
deleteShift (row) {
this.$confirm(`是否删除此条班次信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData = {
site:this.$store.state.user.site.toString(),
datetype:row.datetype,
shiftno:row.shiftno
}
delShift(inData).then(({data}) => {
if (data && data.code == 200) {
getShiftData(this.shiftSearchData).then(({data}) => {
this.shiftList = data.rows
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
},
created() {
this.searchList();
}
}
</script>
<style scoped>
</style>

14
src/views/modules/productionOrder/searchOrderToBeProduced.vue

@ -0,0 +1,14 @@
<template>
</template>
<script>
export default {
//
name: "searchOrderToBeProduced"
}
</script>
<style scoped>
</style>

2
src/views/modules/purchaseorder/procurementReview.vue

@ -120,7 +120,7 @@
</el-steps>
<div style="margin-left: 0px;margin-top: -30px" v-if="active === index" v-for=" (item,index) in reviewStepList" >
<div style="margin-left: 0px;margin-top: -30px" v-if="active === index" v-for=" (item,index) in reviewStepList" :key="index">
<el-form :inline="true" label-width="120px" label-position="top">
<el-form-item label="审批人">
<el-input style="width: 200px;" readonly placeholder="" :value="item.userName"></el-input>

Loading…
Cancel
Save