Browse Source

日期选择有限选中当前日期

master
蟑螂恶霸 2 years ago
parent
commit
847b9abefc
  1. 39
      src/views/administrative/appointment.vue

39
src/views/administrative/appointment.vue

@ -20,7 +20,8 @@
readonly
@click="showPopupCompony"
/>
<Popup :visible="popupVisible" :content="popupContent" @close="closePopupCompony" @reciveData="reciveData" />
<Popup :visible="popupVisible" :content="popupContent" @close="closePopupCompony"
@reciveData="reciveData"/>
<van-field
v-model="submitData.linkMan"
label="企业联系人"
@ -108,11 +109,13 @@
<!-- </div>-->
<van-popup v-model:show="data.showLawEnforcerFlag" position="bottom" :style="{ height: '30%' }"/>
<UserPopup :visible="data.popupVisible" :content="data.popupContent" @close="closePopup" @reciveData="reciveVisible" />
<UserPopup :visible="data.popupVisible" :content="data.popupContent" @close="closePopup"
@reciveData="reciveVisible"/>
<van-popup v-model:show="data.showTimePicker" position="bottom" :style="{ height: '30%' }">
<van-date-picker
type="time"
v-model="data.currentDate"
@confirm="onConfirm"
@cancel="data.showTimePicker = false"
/>
@ -139,7 +142,11 @@
import {showSuccessToast} from 'vant';
import 'vant/es/toast/style';
import {getByUserIdAndZero, addEnterpriseLawEnforcement, editEnterpriseLawEnforcement} from '../../api/administrative'
import {
getByUserIdAndZero,
addEnterpriseLawEnforcement,
editEnterpriseLawEnforcement
} from '../../api/administrative'
import {queryUserInfo} from '../../api/enforce'
import {queryEnterpriseInfoList} from '../../api/enterprise'
import {reactive, ref} from "vue";
@ -148,6 +155,7 @@ import { queryLinkage, queryLinkageDictByValueAndParentId } from "../../api/link
import {uploadFile} from "../../util/fileUpload";
//用户筛选弹窗
import UserPopup from './userFilter.vue';
const {useCommon} = $globalStore;
const router = useRouter();
@ -163,6 +171,7 @@ const data = reactive({
checkRequireText: "",
ga_columns: [],
item_columns: [],
currentDate: []
});
//保存参数
const submitData = reactive({
@ -207,7 +216,13 @@ const submitData = reactive({
userId: useCommon.userId
})
const currentDate =() => {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
data.currentDate = [year, month, day]
}
const onConfirm = (time) => {
if (time != null) {
@ -325,7 +340,8 @@ const getLinkageByValueAndParentId = (value, parentId) => {
// 查询检查要求字典信息
queryLinkageDictByValueAndParentId({"value": value, "parentId": parentId}, success => {
getLinkageByParentIdToItem(success.id)
},error=>{});
}, error => {
});
}
const getLinkageByParentIdToItem = (parentId) => {
@ -339,7 +355,8 @@ const getLinkageByParentIdToItem = (parentId) => {
// getLinkageByParentIdToGA(success[i].id);
// }
}
},error=>{});
}, error => {
});
}
const getLinkageByParentIdToGA = (parentId) => {
@ -353,7 +370,8 @@ const getLinkageByParentIdToGA = (parentId) => {
// submitData.checkRequire = success[i].id;
// }
}
},error=>{});
}, error => {
});
}
//初始化参数,获取扫码的企业统一信用编码
@ -361,6 +379,8 @@ onMounted(() =>{
// 数据填充
dataFillIn();
currentDate();
//查询当前登录人员信息
queryUserInfo(useCommon.userId, success => {
console.log(success.data)
@ -371,7 +391,8 @@ onMounted(() =>{
submitData.lawEnforcerId = success.data.userId;
submitData.lawEnforcement = success.data.dept.deptName;
submitData.lawEnforcementId = success.data.dept.deptId;
},error=>{});
}, error => {
});
getLinkageByValueAndParentId("check_item", "100");
@ -430,6 +451,7 @@ export default {
overflow: hidden;
background-color: #f4f4f4;
}
/* vant4的 Toast 和 Popup 样式冲突,会导致 Toast 变成白底 */
.van-popup.van-toast {
background: var(--van-toast-background) !important;
@ -439,6 +461,7 @@ export default {
width: var(--van-toast-default-width) !important;
max-width: var(--van-toast-max-width) !important;
}
.van-popup.van-toast .van-toast__icon {
font-size: var(--van-toast-icon-size) !important;
}

Loading…
Cancel
Save