Merge remote-tracking branch 'origin/master'

master
xhj 8 months ago
commit 092b6828d9

@ -0,0 +1,107 @@
<template>
<div class="middle-event">
<el-select type="primary" v-model="workType" @change="changeWorkType" v-show="!isRestDay(data)" style="width: 50%;">
<el-option value="0" key="0" label="白班" />
<el-option value="1" key="1" label="二班" />
<el-option value="2" key="2" label="夜班" />
<el-option value="3" key="3" label="双班(白+夜)" />
</el-select>
<el-button type="primary" @click="changeDay(data)" plain >{{ isRestDay(data)?'休息':'工作' }}</el-button>
</div>
</template>
<script>
import {update} from "@/api/sjzx/gcrlWH";
export default {
name:"GcrlProperties",
props:{
data:{
type:Date,
default:{}
},
restDays:{
type:Array,
default: []
},
eb:{
type:Array,
default: []
},
yb:{
type:Array,
default: []
},
sb:{
type:Array,
default: []
},
},
data(){
return{
workType:null,
}
},
mounted(){
this.handler()
console.log(this.workType)
},
methods:{
handler(){
const data=this.dateFormat(this.$props.data)
console.log(data)
if (this.$props.eb.includes(data)){
this.workType='1'
return
}
console.log(this.$props.yb);
if (this.$props.yb.includes(data)){
this.workType='2'
return
}
if (this.$props.sb.includes(data)){
this.workType='3'
return
}
this.workType='0'
},
changeWorkType(val){
const dateF=this.dateFormat(this.$props.data);
update({pb:this.workType,gl:dateF})
},
changeDay(date){
var dateF=this.dateFormat(date);
if (this.$props.restDays.includes(dateF)){
update({xxr:'1',gl:dateF}).then((res)=>{
this.$props.restDays.splice(this.$props.restDays.indexOf(dateF) , 1)
})
}else {
update({xxr:'0',gl:dateF}).then((res)=>{
this.$props.restDays.push(dateF)
})
}
},
isRestDay(date){
const dateF=this.dateFormat(date);
return this.$props.restDays.includes(dateF)
},
dateFormat(date){
const year = date.getFullYear();
const month = ('0' + (date.getMonth() + 1)).slice(-2);
const day = ('0' + date.getDate()).slice(-2);
var dateF=year+'/'+month+'/'+day;
return dateF;
},
isHidden(date){
// let today = new Date(Date.UTC(2024, 5, 18));
let today = new Date();
if (today.getDate()<21){
return !(this.$props.data < today);
}else {
var lastDay= new Date(today.getFullYear(), today.getMonth()+1, 1);
return !(date < lastDay);
}
},
}
}
</script>

@ -40,12 +40,9 @@
:class="{ faded: !isCurrentMonth(day.date),}" :class="{ faded: !isCurrentMonth(day.date),}"
> >
<div class="top-day">{{ day.date.getDate() }}</div> <div class="top-day">{{ day.date.getDate() }}</div>
<div class="middle-event" v-show="isHidden(day.date)" > <GcrlProperties v-if="flag" :data="day.date" :eb="eb" :yb="yb" :sb="sb" :rest-days="restDays"/>
<el-button type="primary" @click="changeDay(day.date)" plain >{{ isRestDay(day.date)?'休息':'工作' }}</el-button>
</div>
<div class="bottom-event" > <div class="bottom-event" >
</div> </div>
</div> </div>
</td> </td>
</tr> </tr>
@ -56,15 +53,22 @@
</template> </template>
<script> <script>
import { getList, generate, update } from "@/api/sjzx/gcrlWH"; import { getList, generate, update } from "@/api/sjzx/gcrlWH";
import GcrlProperties from "@/components/Gcrl/GcrlProperties.vue";
export default { export default {
components: {GcrlProperties},
data() { data() {
return { return {
workType:'0',
current: new Date(), current: new Date(),
today: new Date(), today: new Date(),
restDays:[], restDays:[],
years:[], years:[],
nextYear:0, nextYear:0,
flag:false flag:false,
eb:[],//
yb:[],//
sb:[],//
showProperties:false
}; };
}, },
@ -91,7 +95,6 @@ export default {
} }
}, },
methods: { methods: {
generateNextYear(){ generateNextYear(){
this.years.length-1 this.years.length-1
generate('').then((res) => { generate('').then((res) => {
@ -107,33 +110,12 @@ export default {
this.years = res.data.years; this.years = res.data.years;
this.restDays=res.data.restDays; this.restDays=res.data.restDays;
this.nextYear=res.data.nextYear; this.nextYear=res.data.nextYear;
this.eb=res.data.eb;
this.yb=res.data.yb
this.sb=res.data.sb
this.flag=true this.flag=true
}); });
}, },
changeDay(date){
var dateF=this.dateFormat(date);
if (this.restDays.includes(dateF)){
update({xxr:'1',gl:dateF}).then((res)=>{
this.restDays.splice(this.restDays.indexOf(dateF) , 1)
})
}else {
update({xxr:'0',gl:dateF}).then((res)=>{
this.restDays.push(dateF)
})
}
},
isHidden(date){
// let today = new Date(Date.UTC(2024, 5, 18));
let today = new Date();
if (today.getDate()<21){
return !(date < today);
}else {
var lastDay= new Date(today.getFullYear(), today.getMonth()+1, 1);
return !(date < lastDay);
}
},
getCurDate() { getCurDate() {
var year = this.current.getFullYear(); var year = this.current.getFullYear();
var month = this.current.getMonth() + 1; // getMonth() returns a zero-based value (0-11) var month = this.current.getMonth() + 1; // getMonth() returns a zero-based value (0-11)

@ -6,15 +6,7 @@
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="船号:"> <el-form-item label="船号:">
<el-select v-model="request.dcCh" placeholder="船号" clearable> <ProjectSelect ref="projectSelectRef" :_style="{width:'200px'}"/>
<el-option
v-for="item in ShipNoList"
:key="item.cbbm"
:label="item.cbbm"
:value="item.cbbm"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
@ -39,7 +31,6 @@
<el-button type="success" @click="toolbarButtonClickEvent('submit')" <el-button type="success" @click="toolbarButtonClickEvent('submit')"
>提交</el-button >提交</el-button
> >
<el-button type="primary" @click="initList()"></el-button> <el-button type="primary" @click="initList()"></el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -101,12 +92,13 @@ import { getCzxx } from "@/api/jhzx/qfxq";
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
import {endLoading, startLoading} from "@/utils"; import {endLoading, startLoading} from "@/utils";
import {Message} from "element-ui"; import {Message} from "element-ui";
import ProjectSelect from "@/components/ProjectSelect/index.vue";
export default { export default {
name: "dhqdWH", name: "dhqdWH",
components: {ProjectSelect},
data() { data() {
return { return {
request: { request: {
dcCh: "",
Zt: "0", Zt: "0",
}, },
list: [], list: [],
@ -458,6 +450,69 @@ export default {
], ],
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{
field: "plzlsl",
title: "批量组立数量",
align: "center",
minWidth: "90",
filters: [
{
data: {
checks: [],
sVal: "",
sMenu: "",
fType1: "",
fVal1: "",
fMode: "and",
fType2: "",
fVal2: "",
},
},
],
filterRender: { name: "FilterCombination" },
},
{
field: "kdzlsl",
title: "跨道组立数量",
align: "center",
minWidth: "90",
filters: [
{
data: {
checks: [],
sVal: "",
sMenu: "",
fType1: "",
fVal1: "",
fMode: "and",
fType2: "",
fVal2: "",
},
},
],
filterRender: { name: "FilterCombination" },
},
{
field: "ptybsl",
title: "平铁用板数量",
align: "center",
minWidth: "90",
filters: [
{
data: {
checks: [],
sVal: "",
sMenu: "",
fType1: "",
fVal1: "",
fMode: "and",
fType2: "",
fVal2: "",
},
},
],
filterRender: { name: "FilterCombination" },
},
{ {
field: "Zt", field: "Zt",
title: "状态", title: "状态",
@ -517,7 +572,7 @@ export default {
// //
initList() { initList() {
getList({ getList({
...this.request, ...this.request,dcCh:this.$refs.projectSelectRef.getDcch()
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
this.list = res.data; this.list = res.data;

@ -142,7 +142,7 @@ import { getCzxx } from "@/api/jhzx/qfxq";
import {Message} from "element-ui"; import {Message} from "element-ui";
import {getCzplBase} from "@/api/sjzx/jcsj"; import {getCzplBase} from "@/api/sjzx/jcsj";
export default { export default {
name: "zrcWH", name: "ZrcWH",
data() { data() {
return { return {
uploadData:{ uploadData:{
@ -210,27 +210,27 @@ export default {
], ],
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ // {
field: "zdh", // field: "zdh",
title: "总段号", // title: "",
align: "center", // align: "center",
minWidth: "80", // minWidth: "80",
filters: [ // filters: [
{ // {
data: { // data: {
checks: [], // checks: [],
sVal: "", // sVal: "",
sMenu: "", // sMenu: "",
fType1: "", // fType1: "",
fVal1: "", // fVal1: "",
fMode: "and", // fMode: "and",
fType2: "", // fType2: "",
fVal2: "", // fVal2: "",
}, // },
}, // },
], // ],
filterRender: { name: "FilterCombination" }, // filterRender: { name: "FilterCombination" },
}, // },
{ {
field: "dcFd", field: "dcFd",
title: "分段号", title: "分段号",
@ -252,48 +252,48 @@ export default {
], ],
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ // {
field: "qy", // field: "qy",
title: "区域", // title: "",
align: "center", // align: "center",
minWidth: "70", // minWidth: "70",
filters: [ // filters: [
{ // {
data: { // data: {
checks: [], // checks: [],
sVal: "", // sVal: "",
sMenu: "", // sMenu: "",
fType1: "", // fType1: "",
fVal1: "", // fVal1: "",
fMode: "and", // fMode: "and",
fType2: "", // fType2: "",
fVal2: "", // fVal2: "",
}, // },
}, // },
], // ],
filterRender: { name: "FilterCombination" }, // filterRender: { name: "FilterCombination" },
}, // },
{ // {
field: "yzd", // field: "yzd",
title: "预组段", // title: "",
align: "center", // align: "center",
minWidth: "80", // minWidth: "80",
filters: [ // filters: [
{ // {
data: { // data: {
checks: [], // checks: [],
sVal: "", // sVal: "",
sMenu: "", // sMenu: "",
fType1: "", // fType1: "",
fVal1: "", // fVal1: "",
fMode: "and", // fMode: "and",
fType2: "", // fType2: "",
fVal2: "", // fVal2: "",
}, // },
}, // },
], // ],
filterRender: { name: "FilterCombination" }, // filterRender: { name: "FilterCombination" },
}, // },
{ {
field: "zl", field: "zl",
title: "重量", title: "重量",

Loading…
Cancel
Save