Browse Source

企业名称

xiaowang-data
是小王呀\24601 1 year ago
parent
commit
f98cdb1689
  1. 174
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
  2. 21
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
  3. 46
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss
  4. 8
      utils/api_BACKUP_859.js
  5. 4
      utils/config.js

174
subpages/InspectionReport/pages/InspectionReport/InspectionReport.js

@ -18,10 +18,8 @@ Page({
*/ */
data: { data: {
orderDate:"", orderDate:"",
inspectIf:false,
selectedEnterpriseNames:[], selectedEnterpriseNames:[],
EnterpriseName:[], EnterpriseName:[],
index: 0,
companyList:[], companyList:[],
showtime:false, showtime:false,
checkboxOptions:[], checkboxOptions:[],
@ -75,8 +73,8 @@ Page({
currentDate: new Date().getTime(), currentDate: new Date().getTime(),
minDate: new Date(2020, 0, 1).getTime(), minDate: new Date(2020, 0, 1).getTime(),
maxDate: new Date(2030, 11, 31).getTime(), maxDate: new Date(2030, 11, 31).getTime(),
checkboxValue:[], searchKeyword:"",
searchKeyword:"" showscroll:false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -99,7 +97,9 @@ Page({
}, },
inputChange(val){ inputChange(val){
console.log(val.detail.value); console.log(val.detail.value);
this.data.searchKeyword = val.detail.value.trim(); this.setData({
searchKeyword: val.detail.value // 更新搜索关键词
});
let parm = { let parm = {
name: this.data.searchKeyword, name: this.data.searchKeyword,
pageSize:this.data.pageSize, pageSize:this.data.pageSize,
@ -109,15 +109,12 @@ Page({
console.log(res.data.list); console.log(res.data.list);
this.setData({ this.setData({
companyList:res.data.list, companyList:res.data.list,
showqiye:true // showqiye:true
}) })
console.log( this.data.companyList); console.log( this.data.companyList);
let names = []
res.data.list.forEach(item=>{
names.push(item.name)
})
console.log(names);
this.data.EnterpriseName=names
}) })
// clearTimeout(this.data.timer); // clearTimeout(this.data.timer);
// this.data.timer = setTimeout(() => { // this.data.timer = setTimeout(() => {
@ -135,14 +132,15 @@ Page({
}); });
console.log(this.data.addHiddenDangeList); console.log(this.data.addHiddenDangeList);
}, },
showRecordData() { async showRecordData() {
console.log(this.data.checkboxOptions);
this.setData({ this.setData({
checkboxOptions:[] checkboxOptions:[]
}) })
let parm = { let parm = {
id: this.data.companyId id: this.data.companyId
} }
showRecord(parm).then(res => { await showRecord(parm).then(res => {
if(res.data[0].hiddenDangeList){ if(res.data[0].hiddenDangeList){
let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:0})); let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:0}));
this.setData({ this.setData({
@ -150,6 +148,7 @@ Page({
beforeFlag: res.data[0].checkResultFlag beforeFlag: res.data[0].checkResultFlag
}) })
console.log(this.data.beforeFlag); console.log(this.data.beforeFlag);
console.log(this.data.checkboxOptions);
}else{ }else{
this.setData({ this.setData({
beforeFlag: res.data[0].checkResultFlag beforeFlag: res.data[0].checkResultFlag
@ -157,6 +156,7 @@ Page({
console.log(this.data.beforeFlag) console.log(this.data.beforeFlag)
} }
}) })
console.log(this.data.checkboxOptions);
}, },
getCurrentDateTime() { getCurrentDateTime() {
const now = new Date(); const now = new Date();
@ -205,18 +205,18 @@ Page({
}) })
return false return false
} }
if (this.data.checkboxOptions) { // if (this.data.checkboxOptions) {
console.log(this.data.checkboxOptions) // console.log(this.data.checkboxOptions)
this.data.checkboxOptions.forEach(item => { // this.data.checkboxOptions.forEach(item => {
console.log(item) // console.log(item)
console.log(this.data.checkboxValue) // console.log(this.data.checkboxValue)
if(this.data.checkboxValue.findIndex(itemC=>itemC === item.value) == -1){ // if(this.data.checkboxValue.findIndex(itemC=>itemC === item.value) == -1){
item.hazardStatus = '1'; // item.hazardStatus = '1';
}else{ // }else{
item.hazardStatus = '0'; // item.hazardStatus = '0';
} // }
}) // })
} // }
if (this.data.newContent) { if (this.data.newContent) {
@ -344,10 +344,22 @@ Page({
onShareAppMessage() {}, onShareAppMessage() {},
onChange(event) { onChange(event) {
console.log(event); console.log(event);
console.log(event.detail);
console.log(this.data.checkboxOptions);
this.data.checkboxOptions.forEach((item,index)=>{
if(event.detail.findIndex(item=>item==index) != -1){
console.log(item,"还是0");
item.hazardStatus = 0
}else{
console.log(item,"皆苦额了");
item.hazardStatus = 1
}
})
console.log(this.data.checkboxOptions);
this.setData({ this.setData({
checkboxValue: event.detail checkboxValue:event.detail,
}); })
console.log(this.data.checkboxValue); console.log(this.data.checkboxOptions);
}, },
afterRead(event) { afterRead(event) {
const { const {
@ -410,36 +422,65 @@ Page({
}); });
}, },
onChange2(event) { handleBlur(){
console.log(event);
this.setData({ this.setData({
selectedEnterpriseNames: event.detail, showscroll:false,
searchKeyword:event.detail[0] companyList:[]
});
console.log(event.detail);
console.log(this.data.companyList);
this.data.companyList.forEach(item=>{
if(this.data.searchKeyword==item.name){
this.data.companyId=item.companyId
this.data.orderDate=item.orderDate
}
}) })
const currentDate = new Date(); },
const currentMonth = currentDate.getMonth() + 1; handleFocus(){
const targetMonth = parseInt(this.data.orderDate.substring(5, 7), 10); console.log(this.data.showscroll);
console.log(this.data.companyId,); this.setData({
if (targetMonth === currentMonth) { showscroll:true
this.setData({ })
inspectIf:true let parm = {
}) name: this.data.searchKeyword,
console.log( this.data.inspectIf); pageSize:this.data.pageSize,
} else { pageNo:this.data.pageNo
this.setData({ }
inspectIf:false Enterpriseambiguity(parm).then(res => {
}) console.log(res.data.list);
} this.setData({
companyList:res.data.list,
// showqiye:true
})
console.log( this.data.companyList);
this.data.companyList.forEach(item=>{
this.data.orderDate=item.orderDate;
const currentDate = new Date();
const currentMonth = currentDate.getMonth() + 1;
const targetMonth = parseInt(item.orderDate.substring(5, 7), 10);
console.log(currentMonth,targetMonth);
if (targetMonth === currentMonth) {
console.log("turedv");
item.inspectIf=true
} else {
item.inspectIf=false
}
})
console.log(this.data.companyList);
// let names = []
// res.data.list.forEach(item=>{
// names.push(item.name)
// })
// console.log(names);
// this.data.EnterpriseName=names
})
// this.onChange2()
},
onChange2(event) {
let item = event.currentTarget.dataset.item;
console.log(item);
this.setData({
searchKeyword:item.name,
companyList:item,
companyId:item.companyId,
showscroll:false,
companyList:[]
});
this.showRecordData() this.showRecordData()
}, },
confirmSelection() { confirmSelection() {
@ -498,15 +539,15 @@ Page({
console.log(this.data.getData) console.log(this.data.getData)
// 在这里可以根据选择的值进行相应的逻辑处理 // 在这里可以根据选择的值进行相应的逻辑处理
}, },
pickerChange2: function (e) { // pickerChange2: function (e) {
// 更新当前选中的索引 // // 更新当前选中的索引
this.setData({ // this.setData({
gridNName: this.data.companyList[e.detail.value].name, // gridNName: this.data.companyList[e.detail.value].name,
companyId:this.data.companyList[e.detail.value].id, // companyId:this.data.companyList[e.detail.value].id,
checkboxValue:[] // checkboxValue:[]
}); // });
this.showRecordData() // this.showRecordData()
}, // },
bindRemarkInput(e) { bindRemarkInput(e) {
this.setData({ this.setData({
remarks: e.detail.value remarks: e.detail.value
@ -800,5 +841,8 @@ Page({
onCancel() { onCancel() {
this.setData({ showtime: false }); this.setData({ showtime: false });
},
input122(event){
console.log(event);
} }
}) })

21
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml

@ -17,8 +17,17 @@
<view class="nes"> <view class="nes">
<view class="conclusion"> <view class="conclusion">
<text class="prosecutors_pre">企业名称</text> <text class="prosecutors_pre">企业名称</text>
<div> <div >
<input class="{{inspectIf ? 'search-input1' : 'search-input'}}" type="text" placeholder="请输入要查找的公司" bindconfirm="inputChange" value="{{searchKeyword}}" /> <input class="{{inspectIf ? 'search-input1' : 'search-input'}}" type="text" placeholder="请输入要查找的公司" bindfocus="handleFocus" bindinput="inputChange" value="{{searchKeyword}}" />
<view class="Enterpris">
<scroll-view scroll-y="{{true}}" wx:if="{{ showscroll }}" class="searchKeyword" >
<div class="searchList" wx:for="{{companyList}}" bindtap="onChange2" data-item="{{item}}" wx:key="index">
<view wx:if="{{item.inspectIf}}" class="EnterperiseName "> {{item.name}}</view>
<view wx:if="{{!item.inspectIf}}" class="EnterperiseName1 "> {{item.name}}</view>
</div>
</scroll-view>
</view>
<!-- <picker bindchange="pickerChange2" range-key="name" value="{{index}}" range="{{companyList}}"> <!-- <picker bindchange="pickerChange2" range-key="name" value="{{index}}" range="{{companyList}}">
</picker> --> </picker> -->
<!-- <view class="list-container"> <!-- <view class="list-container">
@ -32,6 +41,7 @@
</view> </view>
</view> </view>
<view class="prosecutors" bind:tap="showPopup"> <view class="prosecutors" bind:tap="showPopup">
<text class="prosecutors_req">*</text> <text class="prosecutors_req">*</text>
<view class="nes"> <view class="nes">
@ -70,7 +80,7 @@
</view> </view>
<view class="checkbox1"> <view class="checkbox1">
<van-checkbox-group value="{{checkboxValue}}" bind:change="onChange" wx:if="{{checkboxOptions}}" > <van-checkbox-group value="{{checkboxValue}}" bind:change="onChange" wx:if="{{checkboxOptions}}" >
<van-checkbox custom-class="group" name="{{item.id}}" wx:for="{{checkboxOptions}}">{{index + 1}}. {{item.hazardDesc}}</van-checkbox> <van-checkbox custom-class="group" name="{{index}}" wx:for="{{checkboxOptions}}" >{{index + 1}}. {{item.hazardDesc}}</van-checkbox>
</van-checkbox-group> </van-checkbox-group>
<view class="addHiddenDangeList" wx:for="{{addHiddenDangeList}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <view class="addHiddenDangeList" wx:for="{{addHiddenDangeList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<input class="addHiddenDangeListText" <input class="addHiddenDangeListText"
@ -164,14 +174,14 @@
</view> </view>
</van-popup> </van-popup>
<!-- 企业名称 --> <!-- 企业名称 -->
<van-popup show="{{ showqiye }}" closeable close-icon="close" position="bottom" custom-style="height: 50%" bind:close="onClose" round> <!-- <van-popup show="{{ showqiye }}" closeable close-icon="close" position="bottom" custom-style="height: 50%" bind:close="onClose" round>
<view class="popup-content"> <view class="popup-content">
<van-checkbox-group max="{{1}}" value="{{selectedEnterpriseNames}}" bind:change="onChange2"> <van-checkbox-group max="{{1}}" value="{{selectedEnterpriseNames}}" bind:change="onChange2">
<van-checkbox name="{{item.name}}" custom-class="checkbox" <van-checkbox name="{{item.name}}" custom-class="checkbox"
wx:for="{{companyList}}" wx:key="index">{{item.name}}</van-checkbox> wx:for="{{companyList}}" wx:key="index">{{item.name}}</van-checkbox>
</van-checkbox-group> </van-checkbox-group>
</view> </view>
</van-popup> </van-popup> -->
<van-popup show="{{ showtime }}" close-icon="close" position="bottom" custom-style="height: 50%" bind:close="closePopup" round> <van-popup show="{{ showtime }}" close-icon="close" position="bottom" custom-style="height: 50%" bind:close="closePopup" round>
<van-datetime-picker <van-datetime-picker
type="datetime" type="datetime"
@ -183,6 +193,7 @@
bind:cancel="onCancel" bind:cancel="onCancel"
/> />
</van-popup> </van-popup>
<van-overlay show="{{ show }}" bind:click="onClickHide" />
<!-- <van-popup show="{{ showTime }}" closeable close-icon="close" position="bottom" custom-style="height: 50%" bind:close="onClose" round> <!-- <van-popup show="{{ showTime }}" closeable close-icon="close" position="bottom" custom-style="height: 50%" bind:close="onClose" round>
<view class="popup-content"> <view class="popup-content">
<van-checkbox-group value="{{selectedOptions}}" bind:change="onChange1"> <van-checkbox-group value="{{selectedOptions}}" bind:change="onChange1">

46
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss

@ -539,4 +539,50 @@ margin-bottom: 20rpx;
white-space: nowrap; white-space: nowrap;
line-height: 42rpx; line-height: 42rpx;
margin-top: 10rpx; margin-top: 10rpx;
}
.Enterpris{
display: flex;
justify-content: center;
align-items: center;
}
.searchKeyword{
display:block;
position: relative;
width:400rpx;
height:260rpx;
background:#FFFFFF;
margin-left: 70rpx;
border-radius: 30rpx;
margin-bottom: 10rpx;
box-shadow: 0 2px 12px rgba(50, 50, 51, 0.12);
padding: 20rpx;
font-size: 28rpx;
}
.searchList{
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
border-bottom: 1px solid #EAEAEA;
}
.EnterperiseName{
width:300rpx;
display: flex;
white-space: nowrap;
overflow-x: hidden;
text-overflow:ellipsis,
}
.EnterperiseName1{
width:300rpx;
display: flex;
color:#999999 ;
white-space: nowrap;
overflow-x: hidden;
text-overflow:ellipsis
} }

8
utils/api_BACKUP_859.js

@ -83,11 +83,8 @@ module.exports = {
showRecord, showRecord,
inspectionStaff, inspectionStaff,
getChangeRecordsById, getChangeRecordsById,
<<<<<<< Updated upstream isUpdater,
isUpdater
=======
Enterpriseambiguity Enterpriseambiguity
>>>>>>> Stashed changes
} }
// 获取公钥 // 获取公钥
@ -435,15 +432,12 @@ function showRecord(parm){
function inspectionStaff(parm){ function inspectionStaff(parm){
return fly.post(`data/aggregator/org/stafflist`,parm) return fly.post(`data/aggregator/org/stafflist`,parm)
} }
<<<<<<< Updated upstream
//两小时内输入密码无需再输入 //两小时内输入密码无需再输入
function isUpdater(id){ function isUpdater(id){
return fly.post(`actual/base/residentCategoryUpdateInfo/isUpdater/${id}`) return fly.post(`actual/base/residentCategoryUpdateInfo/isUpdater/${id}`)
} }
=======
//企业模糊查询 //企业模糊查询
function Enterpriseambiguity(parm){ function Enterpriseambiguity(parm){
return fly.post(`actual/base/companyInfo/page`,parm) return fly.post(`actual/base/companyInfo/page`,parm)
} }
>>>>>>> Stashed changes

4
utils/config.js

@ -5,8 +5,8 @@ module.exports = {
}; };
function BASEURL() { function BASEURL() {
return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境 // return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境
// return 'http://192.168.1.144/api/' //测试环境 return 'http://192.168.1.144/api/' //测试环境
// return 'http://219.146.91.110:30801/api/' // return 'http://219.146.91.110:30801/api/'
// return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境 // return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境
// return 'http://192.168.1.144/api/' //测试环境 // return 'http://192.168.1.144/api/' //测试环境

Loading…
Cancel
Save