| | |
| | | <el-option v-for="item in attendanceStatusList" :key="item.id" :label="item.value" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-button type="text" @click="submitEditOneClick('form')">确定</el-button> |
| | | <el-button type="text" :loading="isAddloadingOne" @click="submitEditOneClick('form')">确定</el-button> |
| | | <el-button type="text" @click="cancelEditClick('isEditOne')">取消</el-button> |
| | | </template> |
| | | </el-form-item> |
| | |
| | | placeholder="请输入" |
| | | class="margin_right_15px" |
| | | ></el-input> |
| | | <el-button type="text" @click="submitEditTwoClick('form')">确定</el-button> |
| | | <el-button type="text" :loading="isAddloadingTwo" @click="submitEditTwoClick('form')">确定</el-button> |
| | | <el-button type="text" @click="cancelEditClick('isEditTwo')">取消</el-button> |
| | | </template> |
| | | </el-form-item> |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | isAddloadingOne:false, |
| | | isAddloadingTwo:false, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | this.isEditOne=true |
| | | }, |
| | | submitEditOneClick(){ |
| | | this.submitForm('form','isEditOne') |
| | | this.submitForm('form','isEditOne','isAddloadingOne') |
| | | }, |
| | | editTwoClick(){ |
| | | this.isEditTwo=true |
| | | }, |
| | | submitEditTwoClick(){ |
| | | this.submitForm('form','isEditTwo') |
| | | this.submitForm('form','isEditTwo','isAddloadingTwo') |
| | | }, |
| | | formInfo() { |
| | | if (this.islook) { |
| | |
| | | this.islook = false; |
| | | this.$emit('shutdown') |
| | | }, |
| | | submitForm(formName,name) { |
| | | submitForm(formName,name,loading) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | let form = JSON.parse(JSON.stringify(this.form)); |
| | |
| | | workTypeId:form.workTypeId, |
| | | workerName:form.workerName, |
| | | } |
| | | this[loading]=true |
| | | updateAttendance(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | |
| | | this[name]=false |
| | | this.cancelMethod(); |
| | | } |
| | | }); |
| | | this[loading]=false |
| | | }).catch(() => { |
| | | setTimeout(() => { |
| | | this[loading]=false |
| | | }, 2000); |
| | | }); |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |