Commit c96b3af7 authored by godwithdh's avatar godwithdh

补卡

parent 9a0b2dce
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
<div class="tip">10. 其他情况</div> <div class="tip">10. 其他情况</div>
<textarea :placeholder="status==2 ? '' : '请输入'" :disabled="status==2" autoHeight="true" v-model="value.sRemark"/> <textarea :placeholder="status==2 ? '' : '请输入'" :disabled="status==2" autoHeight="true" v-model="value.sRemark"/>
</div> </div>
<button @click="upData" v-if="status!=2">{{!status?'提交':'修改'}}</button> <button @click="upData" v-if="status!=2">{{btnName}}</button>
<confirm v-model="isShowConfirm" <confirm v-model="isShowConfirm"
title="提示" title="提示"
...@@ -183,25 +183,33 @@ export default { ...@@ -183,25 +183,33 @@ export default {
sCreateAppid:"", //openID sCreateAppid:"", //openID
iStatus:1, iStatus:1,
}, },
status:0,//0 新增,1 修改,2 只读 status:0,//0 新增,1 修改,2 只读,3 补卡
} }
}, },
computed:{ computed:{
...mapState({ ...mapState({
hdr:state => state.healthStatistics.hdr, hdr:state => state.healthStatistics.hdr,
}) }),
btnName(){
if(this.status==0)return "新增";
else if(this.status==1)return "修改";
else return "补卡"
}
}, },
async activated(){ async activated(){
this.status = parseInt(this.$route.query.readOnly)||0 this.status = parseInt(this.$route.query.readOnly)||0
this.value.sCreateAppid=this.$route.params.openId this.value.sCreateAppid=this.$route.params.openId
if(this.status>0){ if(/^1$|^2$/.test(this.status)){
await this.getHealthDate(); await this.getHealthDate();
}else{ }else{
this.value.iEmploeeId=this.$route.params.id this.value.iEmploeeId=this.$route.params.id
this.value.sAddressFull=this.$route.params.address this.value.sAddressFull=this.$route.params.address
} }
this.value.dCheckDate=this.value.tCreateTime=util.dateFormat(new Date(),"yyyy-MM-dd hh:mm:ss") this.value.dCheckDate=this.value.tCreateTime=util.dateFormat(new Date(),"yyyy-MM-dd hh:mm:ss")
if(this.status=3){
this.value.dCheckDate=util.dateFormat(new Date(Number(this.$route.query.dDate)),"yyyy-MM-dd")
}
}, },
methods:{ methods:{
async getHealthDate(){ async getHealthDate(){
...@@ -254,14 +262,14 @@ export default { ...@@ -254,14 +262,14 @@ export default {
this.saveData() this.saveData()
}, },
async saveData(){ async saveData(){
this.value.iStatus=this.status>0?2:1 this.value.iStatus=this.status==1?2:1
var value=await this.request("saveHealth",{ var value=await this.request("saveHealth",{
data:this.value, data:this.value,
},"加载中",{}) },"加载中",{})
if(/^\d+$/.test(value)){ if(/^\d+$/.test(value)){
wx.miniProgram.navigateBack() wx.miniProgram.navigateBack()
}else{ }else{
this.$vux.toast.text(this.status>0?'修改失败!':'保存失败!', 'middle'); this.$vux.toast.text(this.status==0?'保存':(this.status==1?'修改':'补卡')+'失败!', 'middle');
} }
}, },
checkData(){ checkData(){
......
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