ruanqi 1 year ago
parent
commit
2592d3064e
  1. 29
      src/views/modules/product/operatorGroup.vue

29
src/views/modules/product/operatorGroup.vue

@ -143,6 +143,9 @@
</el-date-picker> </el-date-picker>
<!-- <el-input v-model="detailData.shiftno" style="width: 130px" :disabled="detailData.updateFlag"></el-input>--> <!-- <el-input v-model="detailData.shiftno" style="width: 130px" :disabled="detailData.updateFlag"></el-input>-->
</el-form-item> </el-form-item>
<el-form-item :label="'班次'">
<el-input v-model="detailData.shiftno" style="width: 130px" :disabled="detailData.updateFlag"></el-input>
</el-form-item>
<el-form-item :label="'总工作时间'"> <el-form-item :label="'总工作时间'">
<el-input v-model="detailData.allTime" style="width: 130px" disabled></el-input> <el-input v-model="detailData.allTime" style="width: 130px" disabled></el-input>
</el-form-item> </el-form-item>
@ -151,7 +154,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div >
<div class="rq">
<el-table <el-table
height="250" height="250"
:data="detailList" :data="detailList"
@ -222,7 +225,7 @@
}, },
currentRow:{ currentRow:{
site:'', site:'',
OperatorGroupId:''
operatorGroupId:''
}, },
currentRow2:{ currentRow2:{
site:'', site:'',
@ -439,7 +442,7 @@
methods: { methods: {
changeData(row){ changeData(row){
this.currentRow.site=row.site this.currentRow.site=row.site
this.currentRow.OperatorGroupId=row.operatorID
this.currentRow.operatorGroupId=row.operatorID
this.getGroupPlanHeaderData(); this.getGroupPlanHeaderData();
}, },
getData(){ getData(){
@ -478,9 +481,9 @@
let number1=0 let number1=0
let number2=0 let number2=0
for (let i = 0; i < this.detailList.length; i++) { for (let i = 0; i < this.detailList.length; i++) {
number1+=this.detailList[i].workTime?this.detailList[i].workTime:0
number1+=Number( this.detailList[i].workTime?this.detailList[i].workTime:0)
if(this.detailList[i].workTime!=null&&this.detailList[i].workTime!==0&&this.detailList[i].wagesRate!=null&&this.detailList[i].wagesRate!==0){ if(this.detailList[i].workTime!=null&&this.detailList[i].workTime!==0&&this.detailList[i].wagesRate!=null&&this.detailList[i].wagesRate!==0){
number2+=this.detailList[i].workTime*this.detailList[i].wagesRate
number2+=Number( this.detailList[i].workTime*this.detailList[i].wagesRate)
} }
} }
this.detailData.allTime=number1 this.detailData.allTime=number1
@ -510,7 +513,7 @@
this. detailData={ this. detailData={
updateFlag:true, updateFlag:true,
id:data.id, id:data.id,
operatorGroupId:this.currentRow.operatorID,
operatorGroupId:this.currentRow.operatorGroupId,
workDate:data.workDate, workDate:data.workDate,
shiftno:data.shiftno, shiftno:data.shiftno,
allTime:data.allTime, allTime:data.allTime,
@ -520,7 +523,7 @@
this.detailModelFlag=true this.detailModelFlag=true
}, },
newDetail(){ newDetail(){
if(!this.currentRow){
if(!this.currentRow|| this.currentRow.site==""){
this.$alert("请先选择操作组", '错误', { this.$alert("请先选择操作组", '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
@ -529,10 +532,10 @@
this. detailData={ this. detailData={
site:this.currentRow.site, site:this.currentRow.site,
id:null, id:null,
operatorGroupId:this.currentRow.operatorID,
operatorGroupId:this.currentRow.operatorGroupId,
updateFlag:false, updateFlag:false,
workDate:this.dayjs().format("YYYY-MM-DD"), workDate:this.dayjs().format("YYYY-MM-DD"),
shiftno:"",
shiftno:'',
allTime:0, allTime:0,
wagesTime:0, wagesTime:0,
detailList:[], detailList:[],
@ -546,20 +549,20 @@
}) })
}, },
saveDetail(){ saveDetail(){
if(this.detailData.workDate==""||this.detailData.workDate==null){
if(this.detailData.workDate===""||this.detailData.workDate==null){
this.$alert("请先选择日期", '错误', { this.$alert("请先选择日期", '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false; return false;
} }
if(this.detailData.workDate==""||this.detailData.workDate==null){
this.$alert("请先选择日期", '错误', {
if(this.detailData.shiftno===""||this.detailData.shiftno==null){
this.$alert("请先选择班次", '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false; return false;
} }
this.detailData.detailList=this.detailList this.detailData.detailList=this.detailList
saveOperatorGroupDetail(this.currentRow).then(({data}) => {
saveOperatorGroupDetail(this.detailData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.getGroupPlanHeaderData(); this.getGroupPlanHeaderData();
this.detailModelFlag=false this.detailModelFlag=false

Loading…
Cancel
Save