冲突合并

This commit is contained in:
BianLzhaoMin 2024-11-15 13:12:09 +08:00
commit 82c3fb357d
26 changed files with 817 additions and 234 deletions

View File

@ -230,6 +230,14 @@ export function getAUditingProcessApi(data) {
data: data
})
}
// 月计划-查看数据-审核流程
export function getAUditingProcessProApi(data) {
return request_yn({
url: '/ynPlanApp/proMonth/getCheckDetail',
method: 'post',
data: data
})
}
// 月计划-上报人-获取审核人信息
export function getAUditingUserInfoApi(data) {
return request_yn({

View File

@ -16,3 +16,11 @@ export function getReportMessageApi(data) {
data: data
})
}
// 点击报告获取内容
export function messagePushApi(data) {
return request_yn({
url: '/ynPlanApp/home/setSendNessage',
method: 'post',
data: data
})
}

View File

@ -80,7 +80,7 @@
>
<uni-forms-item label="当前位置" required name="address">
<view class="address-content">
<u--input type="text" placeholder="请填写" v-model="submitParams.address" />
<u--textarea placeholder="请填写" autoHeight v-model="submitParams.address" />
<view class="address-info">
<text>
{{ submitParams.lat }}
@ -88,7 +88,10 @@
<text>
{{ submitParams.lon }}
</text>
<!-- <view @tap="getLocationAddress">点击获取</view> -->
</view>
<!-- <view>{{ demoAddress }}</view> -->
</view>
</uni-forms-item>
<uni-forms-item label="附件上传(1-6张照片)" required>
@ -249,7 +252,9 @@ export default {
date: '',
remark: ''
},
detailsList: []
detailsList: [],
demoAddress: '',
demoAddress_2: ''
}
},
methods: {
@ -439,6 +444,16 @@ export default {
if (res.resMsg == 'success') {
this.riskInfo = res.obj[0]
}
},
getLocationAddress() {
const this_ = this
uni.chooseLocation({
success: function (res) {
this_.submitParams.address = res.address
this_.submitParams.lon = res.longitude
this_.submitParams.lat = res.latitude
}
})
}
},
@ -448,17 +463,35 @@ export default {
//
uni.getLocation({
type: 'gcj02', // gcj02 'wgs84'
// altitude: true,
altitude: false,
geocode: true,
success: res => {
console.log(res, '位置信息--')
this.demoAddress = res
const { latitude, longitude } = res
const { province, city, district, street, streetNum, poiName } = res.address
// const { province, city, district, street, streetNum, poiName } = res.address
this.submitParams.lon = longitude
this.submitParams.lat = latitude
console.log(province, 'province')
this.submitParams.address = `${province}${city}${district}${street}${streetNum}${poiName}`
uni.request({
url: `https://api.map.baidu.com/reverse_geocoding/v3/?ak=PM43nB8eDNTBrXkQwGrTQFcmOni3Z9nO&output=json&coordtype=gcj02ll&location=${latitude},${longitude}`,
method: 'GET',
// data: {
// ak: 'PM43nB8eDNTBrXkQwGrTQFcmOni3Z9nO',
// output: JSON,
// coordtype: 'gcj02ll',
// location: `${longitude},${latitude}`
// },
success: res => {
console.log('解析的地址', res)
this.submitParams.address = res.data.result.formatted_address
}
})
// console.log(longitude.toString().slice(0, 7), '-----')
this.submitParams.lon = longitude.toString().length > 7 ? longitude.toString().slice(0, 7) : longitude
this.submitParams.lat = latitude.toString().length > 6 ? latitude.toString().slice(0, 6) : latitude
// console.log(province, 'province')
// this.submitParams.address = `${province}${city}${district}${street}${streetNum}${poiName}`
},
fail: err => {
console.error('获取位置失败:', err)
@ -466,6 +499,17 @@ export default {
}
})
// uni.chooseLocation({
// success: function (res) {
// // this.demoAddress_2 = res
// console.log('--',res)
// // console.log('' + res.name);
// // console.log('' + res.address);
// // console.log('' + res.latitude);
// // console.log('' + res.longitude);
// }
// })
const _this = this
uni.$on('update', function (data) {
// this_.getViewDataList()
@ -611,9 +655,11 @@ export default {
position: absolute;
right: 0;
top: -30px;
display: flex;
align-items: center;
text {
margin-right: 46rpx;
margin-right: 16rpx;
}
}
}

View File

@ -2050,7 +2050,25 @@ export default {
(this.monthDataList[this.activeFormPages].imgList.length +
this.monthDataList[this.activeFormPages].imgViewList.length)
}
}
},
debounce(fn, delay) {
let timer = null
return (...args) => {
//
if (timer) {
clearTimeout(timer)
}
//
timer = setTimeout(() => {
fn.apply( ...args) // 使 `apply` `this` Vue
}, delay)
}
},
},
created() {
// `onSendMessage`
this.onSaveSubmit = this.debounce(this.onSaveSubmit, 1000);
},
onReady() {},

View File

@ -40,7 +40,7 @@
activeBorderColor="#003778"
activeBackgroundColor="#003778"
style="transform: scale(0.7)"
@tap="onCheckBoxChangeAll()"
@tap="onCheckBoxChangeAll(isAllChecked)"
/>
</label>
</view>
@ -143,11 +143,11 @@
</view>
<view>
暂退人员:
<text v-for="(item, index) in tempPersonList" :key="index">{{ item }}</text>
<text v-for="(item, index) in returnPersonList" :key="index">{{ item }}</text>
</view>
<view>
临时人员:
<text v-for="(item, index) in returnPersonList" :key="index">{{ item }}</text>
<text v-for="(item, index) in tempPersonList" :key="index">{{ item }}</text>
</view>
</view>
@ -191,7 +191,8 @@ export default {
currentIndex: 0,
fixedPersonList: [],
tempPersonList: [],
returnPersonList: []
returnPersonList: [],
isSearch: false
}
},
methods: {
@ -232,13 +233,46 @@ export default {
//
if (this.subUserListTemp.length > 0) {
// this.subUserList = this.subUserListTemp.filter(e => e.isAllChecked == true)
this.subUserListAll.forEach(e => {
this.subUserListTemp.forEach(j => {
if (e.idNumber == j.idNumber) {
this.subUserList.push(JSON.parse(JSON.stringify(j)))
}
// this.subUserListAll.forEach(e => {
// this.subUserListTemp.forEach(j => {
// if (e.idNumber == j.idNumber) {
// this.subUserList.push(JSON.parse(JSON.stringify(j)))
// }
// })
// })
let tempArray = this.personList.filter((e, index) => index != this.currentIndex)
let tempPersonList = []
if (tempArray.length > 0) {
this.subUserList = []
// this.subUserListTemp
tempArray.forEach(e => {
this.subUserListAll.forEach(j => {
if (!e.includes(j.idNumber)) {
// this.subUserList.push(j)
tempPersonList.push(JSON.parse(JSON.stringify(j)))
// this.subUserListTemp.push(JSON.parse(JSON.stringify(j)))
}
})
})
})
// this.subUserList = this.subUserListTemp.filter(e => e.isAllChecked == true)
tempPersonList.forEach(e => {
this.subUserListTemp.forEach(j => {
if (e.idNumber == j.idNumber) {
this.subUserList.push(JSON.parse(JSON.stringify(j)))
}
})
})
// this.subUserList = tempPersonList
} else {
this.subUserListAll.forEach(e => {
this.subUserListTemp.forEach(j => {
if (e.idNumber == j.idNumber) {
this.subUserList.push(JSON.parse(JSON.stringify(j)))
}
})
})
}
} else {
this.subUserList = []
}
@ -250,15 +284,67 @@ export default {
// this.subUserList = this.subUserListTemp.filter(e => e.isAllChecked == false)
// }
if (this.subUserListTemp.length > 0) {
this.subUserListAll.forEach(e => {
this.subUserListTemp.forEach(j => {
if (e.idNumber != j.idNumber) {
this.subUserList.push(JSON.parse(JSON.stringify(e)))
}
// this.subUserListAll.forEach(e => {
// if (!this.subUserListTemp.includes(e)) {
// this.subUserList.push(JSON.parse(JSON.stringify(e)))
// }
// // console.log('', e)
// // this.subUserListTemp.forEach(j => {
// // console.log('', j)
// // if (e.idNumber == j.idNumber) {
// // this.subUserList.push(JSON.parse(JSON.stringify(e)))
// // }
// // })
// })
// this.subUserListTemp.forEach((e)=>{
// this.subUserListAll.forEach((j)=>{
// if(e.idNumber )
// })
// })
let tempArray = this.personList.filter((e, index) => index != this.currentIndex)
let tempPersonList = []
if (tempArray.length > 0) {
this.subUserList = []
// this.subUserListTemp
tempArray.forEach(e => {
this.subUserListAll.forEach(j => {
if (!e.includes(j.idNumber)) {
// this.subUserList.push(j)
tempPersonList.push(JSON.parse(JSON.stringify(j)))
// this.subUserListTemp.push(JSON.parse(JSON.stringify(j)))
}
})
})
})
this.subUserList = this.tempPersonList.filter(
itemA => !this.subUserListTemp.some(itemB => itemB.idNumber == itemA.idNumber)
)
} else {
this.subUserList = this.subUserListAll.filter(
itemA => !this.subUserListTemp.some(itemB => itemB.idNumber == itemA.idNumber)
)
}
} else {
this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll))
let tempArray = this.personList.filter((e, index) => index != this.currentIndex)
let tempPersonList = []
if (tempArray.length > 0) {
this.subUserList = []
// this.subUserListTemp
tempArray.forEach(e => {
this.subUserListAll.forEach(j => {
if (!e.includes(j.idNumber)) {
// this.subUserList.push(j)
tempPersonList.push(JSON.parse(JSON.stringify(j)))
// this.subUserListTemp.push(JSON.parse(JSON.stringify(j)))
}
})
})
this.subUserList = tempPersonList
} else {
this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll))
}
}
}
} else {
@ -272,7 +358,7 @@ export default {
// }
console.log('全部状态---', this.personList)
if (this.subUserListTemp.length == 0) {
if (this.subUserListTemp.length == 0 && !this.isSearch) {
if (this.personList.length > 0) {
this.subUserListAll.forEach(e => {
if (this.personList[this.currentIndex].includes(e.idNumber)) {
@ -300,16 +386,69 @@ export default {
} else {
this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll))
}
} else {
this.subUserListAll.forEach(e => {
this.subUserListTemp.forEach(j => {
if (e.idNumber == j.idNumber) {
this.subUserList.push(JSON.parse(JSON.stringify(j)))
} else {
this.subUserList.push(JSON.parse(JSON.stringify(e)))
}
} else if (this.subUserListTemp.length > 0 && this.isSearch) {
let tempArray = this.personList.filter((e, index) => index != this.currentIndex)
let tempPersonList = []
if (tempArray.length > 0) {
this.subUserList = []
// this.subUserListTemp
tempArray.forEach(e => {
this.subUserListAll.forEach(j => {
if (!e.includes(j.idNumber)) {
// this.subUserList.push(j)
tempPersonList.push(JSON.parse(JSON.stringify(j)))
// this.subUserListTemp.push(JSON.parse(JSON.stringify(j)))
}
})
})
})
// this.subUserList = tempPersonList
tempPersonList.forEach(e => {
this.subUserListTemp.forEach(j => {
if (e.idNumber == j.idNumber) {
// this.subUserList.push(JSON.parse(JSON.stringify(j)))
e.isChecked = true
} else {
// this.subUserList.push(JSON.parse(JSON.stringify(e)))
}
})
})
this.subUserList = tempPersonList
} else {
this.subUserListAll.forEach(e => {
this.subUserListTemp.forEach(j => {
if (e.idNumber == j.idNumber) {
// this.subUserList.push(JSON.parse(JSON.stringify(j)))
e.isChecked = true
} else {
// this.subUserList.push(JSON.parse(JSON.stringify(e)))
}
})
})
this.subUserList = this.subUserListAll
}
} else if (this.subUserListTemp.length == 0 && this.isSearch) {
let tempArray = this.personList.filter((e, index) => index != this.currentIndex)
let tempPersonList = []
if (tempArray.length > 0) {
this.subUserList = []
// this.subUserListTemp
tempArray.forEach(e => {
this.subUserListAll.forEach(j => {
if (!e.includes(j.idNumber)) {
// this.subUserList.push(j)
tempPersonList.push(JSON.parse(JSON.stringify(j)))
// this.subUserListTemp.push(JSON.parse(JSON.stringify(j)))
}
})
})
this.subUserList = tempPersonList
} else {
this.subUserList = this.subUserListAll
}
} else {
}
}
this.totalAmount = this.subUserList.length
@ -324,14 +463,14 @@ export default {
},
onCheckBoxChange(item) {
item.isChecked = !item.isChecked
try {
this.subUserListAll.forEach(e => {
if (e.idNumber == item.idNumber) {
e.isChecked = !eisChecked
throw new Error()
}
})
} catch (error) {}
// try {
// this.subUserListAll.forEach(e => {
// if (e.idNumber == item.idNumber) {
// e.isChecked = !e.isChecked
// throw new Error()
// }
// })
// } catch (error) {}
this.subUserListTemp = []
this.subUserList.forEach(e => {
@ -397,6 +536,7 @@ export default {
this.$refs.popup.close()
},
onSubmit() {
this.isSearch = true
if (this.reamList.length > 0) {
this.subQueryParams.teamName = this.reamList.join(',')
}
@ -419,6 +559,9 @@ export default {
// } else {
// }
this.fixedPersonList = []
this.tempPersonList = []
this.returnPersonList = []
this.subUserList.forEach(e => {
console.log('选择的每一项', e)
@ -453,9 +596,16 @@ export default {
})
},
//
onCheckBoxChangeAll() {
onCheckBoxChangeAll(isAllChecked) {
console.log(isAllChecked, 'isAllChecked')
this.subUserList.forEach(e => {
e.isChecked = !e.isChecked
e.isChecked = !isAllChecked
// this.subUserListAll.forEach(j => {
// if (e.idNumber == j.idNumber) {
// j.isChecked = !j.isChecked
// }
// })
})
if (this.subUserList.every(e => e.isChecked == true)) {

View File

@ -644,11 +644,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -647,11 +647,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -535,11 +535,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -539,11 +539,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -30,6 +30,7 @@
</view>
<view class="send-btn" @tap="onSendMessage">发送</view>
<!-- <view class="send-btn" @tap="handleClick">测试</view> -->
</view>
<!-- 人员弹框 -->
@ -88,7 +89,8 @@
</template>
<script>
import { getPushPersonListApi, getReportMessageApi } from '../../../api/workPlan/my'
import { getPushPersonListApi, getReportMessageApi, messagePushApi } from '../../../api/workPlan/my'
export default {
data() {
return {
@ -99,10 +101,26 @@ export default {
mobilePhoneNumber: '',
phoneList: [],
auditingUserList: [],
pushPersonListAll: []
pushPersonListAll: [],
isSending: false
}
},
methods: {
debounce(fn, delay) {
let timer = null
return (...args) => {
//
if (timer) {
clearTimeout(timer)
}
//
timer = setTimeout(() => {
fn.apply( ...args) // 使 `apply` `this` Vue
}, delay)
}
},
leftClick() {
uni.navigateBack()
},
@ -174,82 +192,251 @@ export default {
this.reportMessage = res
// console.log('', res)
},
//
onSendMessage() {
async onSendMessage() {
// console.log(this, 'this')
if (!this.phoneStr) {
uni.showToast({ title: '请选择收件人或填写收件人号码', icon: 'none' })
// this.isSending = false //
return
}
if (!this.reportMessage) {
uni.showToast({ title: '请填写短信内容', icon: 'none' })
// this.isSending = false //
return
}
const sendPhoneList = this.phoneStr.split(',')
const params = {
content: `【作业计划管控平台】${this.reportMessage}`,
phoneStr: sendPhoneList.join('@')
}
console.log('sendPhoneList', sendPhoneList)
uni.showLoading({ title: '短信正在发送,请勿刷新页面或重复点击!' })
new Promise((resolve, reject) => {
let promisesFun = []
uni.showLoading({ title: '短信正在发送,请不要重复点击', mask: true })
console.log('推送参数', params)
messagePushApi(params).then(res => {
console.log('推送结果', res)
uni.hideLoading()
sendPhoneList.forEach(e => {
console.log(e, '手机号码')
// uni.request Promise
let promise = new Promise((reqResolve, reqReject) => {
let params = {
ddtKey: 'bonusyn',
secretkey: 'IU0ypHbH',
mobile: e,
content: this.reportMessage
}
console.log('发送参数', params)
uni.request({
url: 'http://api.ktsms.cn/sms_token',
method: 'POST',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
// dataType: 'json',
success: res => {
console.log('短信发送成功', res)
reqResolve(res) // reqResolve
},
fail: err => {
console.log(err, '发送失败')
reqReject(err) // reqReject
}
})
})
// promise
promisesFun.push(promise)
})
//
Promise.all(promisesFun)
.then(() => {
resolve() // resolve
})
.catch(err => {
reject(err) // reject
})
})
.then(res => {
// console.log('---')
uni.hideLoading()
if (res.res === 1) {
uni.showToast({ title: '短信发送成功!', icon: 'none' })
setTimeout(() => {
uni.navigateBack()
}, 500)
})
.catch(err => {
uni.hideLoading()
console.log('短信发送失败')
})
} else {
uni.showToast({ title: '短信发送失败!', icon: 'none' })
}
})
}
// //
// async onSendMessage() {
// if (this.isSending) {
// //
// uni.showToast({ title: '', icon: 'none' })
// return
// }
// //
// this.isSending = true
// const sendPhoneList = this.phoneStr.split(',')
// const params = {
// content: `${this.reportMessage}`,
// phoneStr: sendPhoneList.join('@')
// }
// uni.showLoading({ title: '', mask: true })
// console.log(params, '')
// try {
// } catch (error) {
// uni.hideLoading()
// uni.showToast({ title: '', icon: 'none' })
// console.error(error)
// } finally {
// //
// this.isSending = false
// }
// // console.log(res, '')
// // if (!this.phoneStr) {
// // uni.showToast({ title: '', icon: 'none' })
// // return
// // }
// // if (!this.reportMessage) {
// // uni.showToast({ title: '', icon: 'none' })
// // return
// // }
// // const sendPhoneList = this.phoneStr.split(',')
// // const params = {
// // content: `${this.reportMessage}`,
// // phoneStr: sendPhoneList.join('@')
// // }
// // uni.showLoading({ title: '', mask: true })
// // console.log(params, '')
// // const res = await messagePushApi(params)
// // uni.hideLoading()
// // if (res.res == 1) {
// // uni.hideLoading()
// // uni.showToast({ title: '', icon: 'none' })
// // setTimeout(() => {
// // uni.navigateBack()
// // }, 500)
// // } else {
// // uni.showToast({ title: '', icon: 'none' })
// // }
// // console.log(res, '')
// if (true) return
// // console.log('sendPhoneList', sendPhoneList)
// uni.showLoading({ title: '' })
// new Promise((resolve, reject) => {
// let promisesFun = []
// sendPhoneList.forEach(e => {
// console.log(e, '')
// // uni.request Promise
// let promise = new Promise((reqResolve, reqReject) => {
// let params = {
// ddtKey: 'bonusyn',
// secretkey: 'IU0ypHbH',
// mobile: e,
// content: `${this.reportMessage}`
// }
// console.log('', params)
// uni.request({
// url: 'http://api.ktsms.cn/sms_token',
// method: 'POST',
// data: params,
// header: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// },
// // dataType: 'json',
// success: res => {
// console.log('', res)
// reqResolve(res) // reqResolve
// },
// fail: err => {
// console.log(err, '')
// reqReject(err) // reqReject
// }
// })
// })
// // promise
// promisesFun.push(promise)
// })
// //
// Promise.all(promisesFun)
// .then(() => {
// resolve() // resolve
// })
// .catch(err => {
// reject(err) // reject
// })
// })
// .then(res => {
// // console.log('---')
// uni.hideLoading()
// uni.showToast({ title: '', icon: 'none' })
// setTimeout(() => {
// uni.navigateBack()
// }, 500)
// })
// .catch(err => {
// uni.hideLoading()
// console.log('')
// })
// },
// onSendMessage: debounce(
// function () {
// console.log(this,'this')
// // const this_ = this
// if (!this.phoneStr) {
// uni.showToast({ title: '', icon: 'none' })
// this.isSending = false //
// return
// }
// if (!this.reportMessage) {
// uni.showToast({ title: '', icon: 'none' })
// this.isSending = false //
// return
// }
// const sendPhoneList = this.phoneStr.split(',')
// const params = {
// content: `${this.reportMessage}`,
// phoneStr: sendPhoneList.join('@')
// }
// uni.showLoading({ title: '', mask: true })
// console.log('', params)
// messagePushApi(params).then(res => {
// console.log('', res)
// uni.hideLoading()
// if (res.res == 1) {
// uni.showToast({ title: '', icon: 'none' })
// setTimeout(() => {
// uni.navigateBack()
// }, 500)
// } else {
// uni.showToast({ title: '', icon: 'none' })
// }
// })
// }.bind(this),
// 1500
// )
// onSendMessage: debounce(() => {
// // 使 `this`
// console.log(this, 'this') // `this` Vue
// if (!this.phoneStr) {
// uni.showToast({ title: '', icon: 'none' })
// // this.isSending = false //
// return
// }
// if (!this.reportMessage) {
// uni.showToast({ title: '', icon: 'none' })
// // this.isSending = false //
// return
// }
// const sendPhoneList = this.phoneStr.split(',')
// const params = {
// content: `${this.reportMessage}`,
// phoneStr: sendPhoneList.join('@')
// }
// uni.showLoading({ title: '', mask: true })
// console.log('', params)
// messagePushApi(params).then(res => {
// console.log('', res)
// uni.hideLoading()
// if (res.res == 1) {
// uni.showToast({ title: '', icon: 'none' })
// setTimeout(() => {
// uni.navigateBack()
// }, 500)
// } else {
// uni.showToast({ title: '', icon: 'none' })
// }
// })
// }, 1500)
},
created() {
// `onSendMessage`
this.onSendMessage = this.debounce(this.onSendMessage, 1000);
}
}
</script>

View File

@ -650,11 +650,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -210,7 +210,7 @@ import {
getRiskLevelListApi,
getControlLevelListApi,
updateInfPlanContentProApi,
getAUditingProcessApi,
getAUditingProcessProApi,
getAUditingUserInfoApi,
// setMonthPlanApi,
setAuditingRejectProApi
@ -242,10 +242,10 @@ export default {
{ title: '提交', id: 4, type: 'upload', isShow: ['1', '2', '3'], isRoles: ['22', '23'] }
],
productionFormLabel: [
{ form_label: '作业内容', items_type: 'ipt', name: 'area', required: true },
{ form_label: '实施单位', items_type: 'ipt', name: 'area', required: true },
{ form_label: '实施部门', items_type: 'ipt', name: 'area', required: true },
{ form_label: '任务来源', items_type: 'ipt', name: 'area', required: true },
{ form_label: '作业内容', items_type: 'area', name: 'zynr', required: true },
{ form_label: '实施单位', items_type: 'area', name: 'ssdw', required: true },
{ form_label: '实施部门', items_type: 'area', name: 'ssbm', required: true },
{ form_label: '任务来源', items_type: 'area', name: 'rwly', required: true },
{
form_label: '作业类型',
items_type: 'sel',
@ -331,7 +331,7 @@ export default {
]
},
{ form_label: '备注', items_type: 'ipt', name: 'bz', required: false },
{ form_label: '计划数量', items_type: 'ipt', name: 'planCount', isType: 'number', required: true }
{ form_label: '计划数量', items_type: 'ipt', isType: 'number', name: 'planCount', required: true }
],
kjsAmount: 0,
dfxAmount: 0,
@ -537,7 +537,7 @@ export default {
// }
// console.log('paramsparams', params)
const res = await getAUditingProcessApi(this.params)
const res = await getAUditingProcessProApi(this.params)
console.log('res审核流程', res)
res.obj.forEach(e => {
@ -600,11 +600,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -544,11 +544,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -13,7 +13,7 @@
<view>
<view class="item-header">
<text>{{ month }}</text>
<!-- <text>{{ month }}</text> -->
<text v-if="kjsAmount > 0" style="color: #06bd36">可接受风险:{{ kjsAmount }}</text>
<text v-if="dfxAmount > 0" style="color: #06bd36">低风险:{{ dfxAmount }}</text>
<text v-if="zfxAmount > 0" style="color: #f28b00">中风险:{{ zfxAmount }}</text>
@ -189,13 +189,13 @@ import {
updateInfPlanContentProApi,
getAUditingUserInfoApi,
setMonthPlanProApi,
getAUditingProcessApi
getAUditingProcessProApi
} from '../../../api/workPlan/monthPlan'
export default {
data() {
return {
monthDetailsList: [],
proId: '',
editDisabled: false,
state: '',
month: '',
@ -239,20 +239,17 @@ export default {
],
productionFormLabel: [
{ form_label: '作业内容', items_type: 'ipt', name: 'area', required: true },
{ form_label: '实施单位', items_type: 'ipt', name: 'area', required: true },
{ form_label: '实施部门', items_type: 'ipt', name: 'area', required: true },
{ form_label: '任务来源', items_type: 'ipt', name: 'area', required: true },
{ form_label: '作业内容', items_type: 'area', name: 'zynr', required: true },
{ form_label: '实施单位', items_type: 'area', name: 'ssdw', required: true },
{ form_label: '实施部门', items_type: 'area', name: 'ssbm', required: true },
{ form_label: '任务来源', items_type: 'area', name: 'rwly', required: true },
{
form_label: '作业类型',
items_type: 'sel',
name: 'zylx',
required: true,
options: [
{ value: 0, text: '检修' },
{ value: 1, text: '维护' }
]
options: []
},
{ form_label: '计划开始时间', items_type: 'date', name: 'kssj', required: true },
{ form_label: '计划结束时间', items_type: 'date', name: 'jssj', required: true },
@ -262,8 +259,8 @@ export default {
name: 'sftd',
required: true,
options: [
{ value: 1, text: '是' },
{ value: 0, text: '否' }
{ value: '1', text: '是' },
{ value: '0', text: '否' }
]
},
{ form_label: '停电设备(作业场所)', items_type: 'ipt', name: 'tdsb', required: true },
@ -288,12 +285,7 @@ export default {
items_type: 'sel',
name: 'gkfs',
required: true,
options: [
{ value: 0, text: '过程管控' },
{ value: 1, text: '巡视管控' },
{ value: 2, text: '驻点管控' },
{ value: 2, text: '节点管控' }
]
options: []
},
{
form_label: '施工方案',
@ -301,8 +293,8 @@ export default {
name: 'sgfa',
required: true,
options: [
{ value: 1, text: '是' },
{ value: 0, text: '否' }
{ value: '1', text: '是' },
{ value: '0', text: '否' }
]
},
{
@ -311,8 +303,8 @@ export default {
name: 'zyzds',
required: true,
options: [
{ value: 0, text: '是' },
{ value: 1, text: '否' }
{ value: '1', text: '是' },
{ value: '0', text: '否' }
]
},
{
@ -321,8 +313,8 @@ export default {
name: 'zybd',
required: true,
options: [
{ value: 0, text: '是' },
{ value: 1, text: '否' }
{ value: '1', text: '是' },
{ value: '0', text: '否' }
]
},
{
@ -331,12 +323,12 @@ export default {
name: 'gzp',
required: true,
options: [
{ value: 0, text: '是' },
{ value: 1, text: '否' }
{ value: '1', text: '是' },
{ value: '0', text: '否' }
]
},
{ form_label: '备注', items_type: 'ipt', name: 'bz' },
{ form_label: '计划数量', items_type: 'ipt', name: 'planCount', required: true, isType: 'number' }
{ form_label: '备注', items_type: 'ipt', name: 'bz', required: false },
{ form_label: '计划数量', items_type: 'ipt', isType: 'number', name: 'planCount', required: true }
],
kjsAmount: 0,
dfxAmount: 0,
@ -548,6 +540,34 @@ export default {
},
/* 确定 */
async onHandlerSubmit() {
// const ids = this.auditingUserList.map(e => {
// if (e.isChecked) return e.id
// })
// let idsStr = ids.filter(e => e != null).join(',')
// const params = {
// id: JSON.stringify(this.monthDetailsList),
// user: idsStr,
// state: '2'
// }
// console.log('saveParams', params)
// const result = await setMonthPlanProApi(params)
// if (result.res == 1) {
// uni.showToast({ title: ``, icon: 'none' })
// setTimeout(() => {
// uni.navigateBack({
// delta: 1,
// success() {
// uni.$emit('update')
// }
// })
// }, 500)
// } else {
// uni.showToast({ title: ``, icon: 'none' })
// }
const ids = this.auditingUserList.map(e => {
if (e.isChecked) return e.id
})
@ -555,14 +575,16 @@ export default {
let idsStr = ids.filter(e => e != null).join(',')
const params = {
id: JSON.stringify(this.monthDetailsList),
user: idsStr,
state: '2'
id: this.proId,
user: idsStr
// state: '2'
}
console.log('saveParams保存参数', params)
const result = await setMonthPlanProApi(params)
const result = await submitPlanProApi(params)
console.log(result, 'results上报人提交结果')
if (result.res == 1) {
uni.showToast({ title: `提交成功!`, icon: 'none' })
setTimeout(() => {
@ -585,7 +607,7 @@ export default {
}
console.log('paramsparams参数', params)
const res = await getAUditingProcessApi(params)
const res = await getAUditingProcessProApi(params)
console.log('res审核流程', res)
res.obj.forEach(e => {
@ -648,11 +670,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
isSHowBtn(item) {
@ -672,11 +694,13 @@ export default {
onLoad(options) {
this.state = options.state
this.month = options.month
this.proId = options.id
console.log('options.state', options.state, options.month)
Promise.all([this.getRiskLevelListData(), this.getControlLevelListData()]).then(res => {
this.params.id = options.id
this.getPlanDetailData()
})
this.getAUditingProcessData()
},
onReady() {
let that = this
@ -757,6 +781,93 @@ export default {
border-bottom: 1px solid #003778;
color: #003778 !important;
}
.process-container {
padding: 20rpx;
background-color: #fff;
border-top: 2px solid #ccc;
h1 {
margin-bottom: 20rpx;
font-size: 40rpx;
letter-spacing: 2px;
}
.process-item {
display: flex;
justify-content: space-between;
}
.process-item view:first-child {
position: relative;
width: 20%;
height: 80rpx;
color: #fff;
// background-color: #00337a;
border-radius: 12rpx;
image {
width: 100%;
height: 80rpx;
}
.type-icon {
// box-sizing: border-box;
position: absolute;
bottom: 0;
right: 0;
height: 35rpx;
width: 35rpx;
border-radius: 50%;
text-align: center;
line-height: 35rpx;
transform: translate(25%, 25%);
border: 3px solid #fff;
background-color: green;
}
}
.process-item .box-2 {
flex: 1;
padding-left: 26rpx;
display: flex;
flex-direction: column;
.text_1 {
font-size: 28rpx;
color: #7e7e7e;
}
.text_2 {
width: 100%;
display: flex;
// display: block;
justify-content: space-between;
align-items: center;
margin-top: 16rpx;
font-size: 24rpx;
color: #000;
}
}
.process-item .box-3 {
width: 30%;
font-size: 22rpx;
color: #333;
}
.line {
margin: 28rpx 0;
.line-content {
width: 20%;
view {
margin: 0 auto;
height: 60rpx;
width: 2px;
background-color: #00337a;
}
}
}
}
.auditing-content {
width: 95vw;
height: 60vh;

View File

@ -313,6 +313,10 @@
<text>{{ item.planTime }}</text>
</view>
<view class="item-pro">
<text>工程名称</text>
<text>{{ item.proName }}</text>
</view>
<view class="item-num">
<text>计划数量</text>
<text>{{ item.planCount }}</text>
@ -363,6 +367,10 @@
<text>{{ item.planTime }}</text>
</view>
<view class="item-pro">
<text>工程名称</text>
<text>{{ item.proName }}</text>
</view>
<view class="item-num">
<text>计划数量</text>
<text>{{ item.planCount }}</text>
@ -1780,7 +1788,8 @@ export default {
}
.item-num,
.item-time {
.item-time,
.item-pro {
width: 96%;
margin: 0 auto;
padding: 12rpx 0;
@ -1789,6 +1798,9 @@ export default {
justify-content: space-between;
font-size: 26rpx;
}
.item-pro text:first-child {
width: 30%;
}
.item-num {
margin-top: 18rpx;
}

View File

@ -313,6 +313,10 @@
<text>{{ item.planTime }}</text>
</view>
<view class="item-pro">
<text>工程名称</text>
<text>{{ item.proName }}</text>
</view>
<view class="item-num">
<text>计划数量</text>
@ -363,6 +367,10 @@
<text>{{ item.planTime }}</text>
</view>
<view class="item-pro">
<text>工程名称</text>
<text>{{ item.proName }}</text>
</view>
<view class="item-num">
<text>计划数量</text>
@ -1776,7 +1784,8 @@ export default {
}
.item-num,
.item-time {
.item-time,
.item-pro {
width: 96%;
margin: 0 auto;
padding: 12rpx 0;
@ -1788,6 +1797,9 @@ export default {
.item-num {
margin-top: 18rpx;
}
.item-pro text:first-child {
width: 30%;
}
.item-num text:last-child {
width: 60%;
text-align: left;

View File

@ -604,11 +604,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -662,11 +662,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -691,11 +691,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -556,11 +556,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -586,11 +586,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -648,11 +648,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -745,11 +745,11 @@ export default {
}
}
})
this.processList.forEach(e => {
/* this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
}) */
}
},
/* 复选框事件 */

View File

@ -631,11 +631,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -642,11 +642,11 @@ export default {
}
}
})
this.processList.forEach(e => {
if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1)
}
})
// this.processList.forEach(e => {
// if (e.auditingInfo.length > 1) {
// e.auditingInfo = e.auditingInfo.splice(-1, 1)
// }
// })
}
},
/* 复选框事件 */

View File

@ -10,13 +10,26 @@ let timeout = 60000
const baseUrl = config.workPlanNewYnUrl
console.log('token', token)
let isRequesting = false // 请求锁,防止重复请求
const request = config => {
// 如果正在请求中,直接返回一个 rejected promise
if (isRequesting) {
// return uni.showToast({ title: '请求正在处理中...请稍后', icon: 'none' })
// return Promise.reject('请求正在处理中,请稍后再试')
// uni.showToast({ title: '请求正在处理中...', icon: 'none' })
}
// 设置请求正在进行
isRequesting = true
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
config.header = config.header || {}
if (token && !isToken) {
config.header['Authorization'] = 'Bearer ' + token
}
// get请求映射params参数
if (config.params) {
let url = config.url + '?' + tansParams(config.params)
@ -31,6 +44,7 @@ const request = config => {
}
// config.data = JSON.stringify(config.data);
}
return new Promise((resolve, reject) => {
uni
.request({
@ -42,15 +56,18 @@ const request = config => {
dataType: 'json'
})
.then(response => {
// console.log(response)
let [error, res] = response
if (error) {
toast('后端接口连接异常')
// 请求完成,解除锁定
isRequesting = false
reject('后端接口连接异常')
return
}
const code = res.data.code || 200
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
@ -59,18 +76,29 @@ const request = config => {
})
}
})
// 请求完成,解除锁定
isRequesting = false
reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
toast(msg)
// 请求完成,解除锁定
isRequesting = false
reject(msg)
} else if (code !== 200) {
toast(msg)
// 请求完成,解除锁定
isRequesting = false
reject(msg)
}
// 请求完成,解除锁定
isRequesting = false
resolve(res.data)
})
.catch(error => {
let { message } = error
// 请求异常处理
if (message === 'Network Error') {
message = '后端接口连接异常'
} else if (message.includes('timeout')) {
@ -78,6 +106,9 @@ const request = config => {
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
// 请求完成,解除锁定
isRequesting = false
toast(message)
reject(error)
})