Browse Source

企业名称

xiaowang-data
是小王呀\24601 1 year ago
parent
commit
f98cdb1689
  1. 162
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
  2. 19
      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

162
subpages/InspectionReport/pages/InspectionReport/InspectionReport.js

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

19
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml

@ -18,7 +18,16 @@
<view class="conclusion">
<text class="prosecutors_pre">企业名称</text>
<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> -->
<!-- <view class="list-container">
@ -32,6 +41,7 @@
</view>
</view>
<view class="prosecutors" bind:tap="showPopup">
<text class="prosecutors_req">*</text>
<view class="nes">
@ -70,7 +80,7 @@
</view>
<view class="checkbox1">
<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>
<view class="addHiddenDangeList" wx:for="{{addHiddenDangeList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<input class="addHiddenDangeListText"
@ -164,14 +174,14 @@
</view>
</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">
<van-checkbox-group max="{{1}}" value="{{selectedEnterpriseNames}}" bind:change="onChange2">
<van-checkbox name="{{item.name}}" custom-class="checkbox"
wx:for="{{companyList}}" wx:key="index">{{item.name}}</van-checkbox>
</van-checkbox-group>
</view>
</van-popup>
</van-popup> -->
<van-popup show="{{ showtime }}" close-icon="close" position="bottom" custom-style="height: 50%" bind:close="closePopup" round>
<van-datetime-picker
type="datetime"
@ -183,6 +193,7 @@
bind:cancel="onCancel"
/>
</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>
<view class="popup-content">
<van-checkbox-group value="{{selectedOptions}}" bind:change="onChange1">

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

@ -540,3 +540,49 @@ margin-bottom: 20rpx;
line-height: 42rpx;
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,
inspectionStaff,
getChangeRecordsById,
<<<<<<< Updated upstream
isUpdater
=======
isUpdater,
Enterpriseambiguity
>>>>>>> Stashed changes
}
// 获取公钥
@ -435,15 +432,12 @@ function showRecord(parm){
function inspectionStaff(parm){
return fly.post(`data/aggregator/org/stafflist`,parm)
}
<<<<<<< Updated upstream
//两小时内输入密码无需再输入
function isUpdater(id){
return fly.post(`actual/base/residentCategoryUpdateInfo/isUpdater/${id}`)
}
=======
//企业模糊查询
function Enterpriseambiguity(parm){
return fly.post(`actual/base/companyInfo/page`,parm)
}
>>>>>>> Stashed changes

4
utils/config.js

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

Loading…
Cancel
Save