Commit 9a0b2dce authored by godwithdh's avatar godwithdh

confirm

parent 3f28eccd
......@@ -141,23 +141,30 @@
<textarea :placeholder="status==2 ? '' : '请输入'" :disabled="status==2" autoHeight="true" v-model="value.sRemark"/>
</div>
<button @click="upData" v-if="status!=2">{{!status?'提交':'修改'}}</button>
<confirm v-model="isShowConfirm"
title="提示"
@on-confirm="onConfirm">
<p style="text-align:center;">修改数据会覆盖原来的数据,是否继续?</p>
</confirm>
</div>
</template>
<script>
import util from "@/libs/util.js"
import {mapState} from 'vuex';
import { XAddress,ChinaAddressV4Data,Datetime,XInput } from 'vux'
import { XAddress,ChinaAddressV4Data,Datetime,XInput,Confirm } from 'vux'
export default {
name: 'punchClockDetail',
components:{XAddress,Datetime,XInput},
components:{XAddress,Datetime,XInput,Confirm},
data () {
return {
address:[],
addressData:ChinaAddressV4Data,
showAddress:false,
isShowDate:false,
isShowConfirm:false,
value:{
iEmploeeId:"", //员工主键
dCheckDate:"", //打卡日期
......@@ -234,8 +241,19 @@ export default {
onShadowChange(e){
console.log(e)
},
async upData(){//保存数据
upData(){//保存数据
if(this.checkData()){
if(this.status>0){
this.isShowConfirm=true
}else{
this.saveData()
}
}
},
onConfirm(){
this.saveData()
},
async saveData(){
this.value.iStatus=this.status>0?2:1
var value=await this.request("saveHealth",{
data:this.value,
......@@ -245,7 +263,6 @@ export default {
}else{
this.$vux.toast.text(this.status>0?'修改失败!':'保存失败!', 'middle');
}
}
},
checkData(){
if(!this.value.sStatus){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment