From c2963af2c6c786f0b527c45929e7d51b4189201f Mon Sep 17 00:00:00 2001 From: guoweilong Date: Wed, 12 Jun 2024 13:58:12 +0800 Subject: [PATCH] fix:修改bug --- components/basisCellCard/basisCellCard.vue | 1 + components/popUpComponent/popUpComponent.vue | 8 ++++++-- components/popUpFillIn/popUpFillIn.vue | 46 +++++++++++++++++++++++++--------------------- pages/charge/constructionMaintenance/detail.vue | 9 +++++++-- pages/charge/constructionMaintenance/index.vue | 49 ++++++++++++++++++++++++++++++++----------------- pages/charge/ignitionMaintenance/detail.vue | 7 ++++++- pages/charge/ignitionMaintenance/index.vue | 16 ++++++++++------ pages/charge/visitsAndFees/createaVisit.vue | 24 ++++++++++++++++-------- pages/charge/visitsAndFees/detail.vue | 21 +++++++++++++-------- pages/charge/visitsAndFees/index.vue | 34 +++++++++++++++++++++------------- pages/login/mobile.vue | 22 ++++++++++++---------- pages/login/workbench.vue | 24 +++++++++++++++++------- 12 files changed, 166 insertions(+), 95 deletions(-) diff --git a/components/basisCellCard/basisCellCard.vue b/components/basisCellCard/basisCellCard.vue index ab7bbf5..cd4c006 100644 --- a/components/basisCellCard/basisCellCard.vue +++ b/components/basisCellCard/basisCellCard.vue @@ -23,6 +23,7 @@ :height="'60px'" :deletable = "false" multiple + :disabled="true" :maxCount="item.value.length" > diff --git a/components/popUpComponent/popUpComponent.vue b/components/popUpComponent/popUpComponent.vue index 1b9fa5a..970ff6d 100644 --- a/components/popUpComponent/popUpComponent.vue +++ b/components/popUpComponent/popUpComponent.vue @@ -71,8 +71,10 @@ if (this.publishStatus === 'PENDING_LEVEL_1_AUDIT') { const result = await submitAuditOne(data); if (result.code === 200) { - that.$emit('getList'); uni.$u.toast(`${this.title}成功`) + setTimeout(()=>{ + that.$emit('getList'); + },300) } else { uni.$u.toast(result.msg) } @@ -81,8 +83,10 @@ if (this.publishStatus === 'PENDING_LEVEL_2_AUDIT') { const result = await submitAuditTwo(data); if (result.code === 200) { - that.$emit('getList'); uni.$u.toast(`${this.title}成功`) + setTimeout(()=>{ + that.$emit('getList'); + },300) } else { uni.$u.toast(result.msg) } diff --git a/components/popUpFillIn/popUpFillIn.vue b/components/popUpFillIn/popUpFillIn.vue index 8f8f6e9..be70697 100644 --- a/components/popUpFillIn/popUpFillIn.vue +++ b/components/popUpFillIn/popUpFillIn.vue @@ -28,7 +28,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -76,12 +76,12 @@ - + - + @@ -130,12 +130,8 @@ type: String, default: "" }, - IgnitionID: { - type: Number - }, - userCode: { - type: String, - default: "" + itemData: { + type: Object }, }, data() { @@ -163,7 +159,13 @@ }, methods: { open() { - this.model.userCode = this.userCode; + if (this.itemData.assignmentTime) { + this.model.assignmentTime = this.itemData.assignmentTime.slice(0, -9); + } + if (this.itemData.userCode) { + this.model.userCode = this.itemData.userCode; + } + this.model = {...this.model}; this.show = true; }, close() { @@ -226,11 +228,11 @@ uni.$u.toast('选择市场派单时间'); return } - if (!this.model.gctMtrrisTime && this.radiovalueGCWH === '是') { + if (this.model.gctMtrrisTime === 'W' && this.radiovalueYYWH === '是') { uni.$u.toast('请选择通气到表前时间'); return } - if (!this.model.gctNcmpRsn && this.radiovalueGCWH === '否') { + if (!this.model.gctNcmpRsn && this.radiovalueYYWH === '否') { uni.$u.toast('请选择未完成原因'); return } @@ -240,10 +242,10 @@ }, async submitDh() { let data = { - id: this.IgnitionID, + id: this.itemData.id, ignCnfStatusCode: this.radiovalueDHWH === '是' ? 'Y' : 'N', nIgnRsn: this.model.nIgnRsn, - userCode:this.model.userCode, + userCode: this.model.userCode, ignTime: this.radiovalueDHWH === '是' ? this.model.ignTime + ' 00:00:00' : '' } console.log(this.radiovalueGCWH); @@ -259,7 +261,7 @@ }, async submitGc() { let data = { - id: this.IgnitionID, + id: this.itemData.id, isCompleted: this.radiovalueGCWH === '是' ? 'Y' : 'N', assignmentTime: this.radiovalueGCWH === '是' ? this.model.assignmentTime + ' 00:00:00' : "", completionTime: this.radiovalueGCWH === '是' ? this.model.completionTime + ' 00:00:00' : "", @@ -278,7 +280,7 @@ }, async submitYy() { let data = { - id: this.IgnitionID, + id: this.itemData.id, gasConnMtrRis: this.radiovalueYYWH === '是' ? 'Y' : 'N', assignmentTime: this.radiovalueYYWH === '是' ? this.model.assignmentTime + ' 00:00:00' : "", gctMtrrisTime: this.radiovalueYYWH === '是' ? this.model.gctMtrrisTime + ' 00:00:00' : "", @@ -300,15 +302,17 @@ this.dhShow = true } else { this.dhShow = false; - this.model = {} + // this.model = {} } }, GCchange(e) { if (e === '是') { - this.gcShow = true + this.gcShow = true; + this.model.nonNcmpRsn = ""; } else { this.gcShow = false; - this.model = {} + // this.model = {} + this.model.completionTime = ""; } }, YYchange(e) { @@ -316,7 +320,7 @@ this.yyShow = true } else { this.yyShow = false; - this.model = {} + // this.model = {} } }, multipleChange(name) { diff --git a/pages/charge/constructionMaintenance/detail.vue b/pages/charge/constructionMaintenance/detail.vue index 902c6a7..87c9135 100644 --- a/pages/charge/constructionMaintenance/detail.vue +++ b/pages/charge/constructionMaintenance/detail.vue @@ -1,6 +1,6 @@ @@ -100,7 +100,7 @@ name: "是否通气到表前/立管", value: "", key: "gasConnMtrRis", - // dict:'sys_yes_no' + dict:'sys_yes_no' }, { name: "是否通气到表前/立管时间", value: "", @@ -131,6 +131,11 @@ this.objData = JSON.parse(data.objData); console.log('传递data', JSON.parse(JSON.stringify(this.objData))); this.dataList = this.$assignValues(this.objData, this.dataList); + // 如果已点火则手动删除未点火原因 + const hasIgnCnfStatusCodeY = this.dataList.some(item => item.key === 'isCompleted' && item.value === 'Y'); + if (hasIgnCnfStatusCodeY) { + this.dataList = this.dataList.filter(item => item.key !== 'nonNcmpRsn' && item.key !== 'gctNcmpRsn'); + } } }, methods: { diff --git a/pages/charge/constructionMaintenance/index.vue b/pages/charge/constructionMaintenance/index.vue index c0e55f2..2b3f652 100644 --- a/pages/charge/constructionMaintenance/index.vue +++ b/pages/charge/constructionMaintenance/index.vue @@ -59,14 +59,24 @@ - - 查看详情 + + 查看详情 - - 工程维护 + + 工程维护 - - 运营维护 + + 工程变更 + + + 运营维护 + + + 运营变更 @@ -94,6 +105,7 @@ getCompanyCascader, getMcConstructionList } from '@/api/charge.js' + import * as dd from 'dingtalk-jsapi' export default { components: {}, props: { @@ -101,7 +113,7 @@ }, data() { return { - title: "施工维护", + title: "", keyword: "", actionStyle: { 'color': '#fff', @@ -122,7 +134,7 @@ status: "loadmore", list: [], total: null, - IgnitionID: 0, + itemData: {}, searchForm: { companyCode: "", isCompleted: "", @@ -192,12 +204,12 @@ uni.stopPullDownRefresh(); }, 500); }, - // onLoad() { - // this.initData() - // }, - onShow() { - this.getCompanyCascader(); + onLoad() { this.initData(); + this.getCompanyCascader(); + }, + onShow() { + // this.initData(); }, methods: { async initData() { @@ -213,7 +225,7 @@ this.list = rows; } this.total = total; - if(this.total < this.params.pageNum * this.params.pageSize){ + if (this.total < this.params.pageNum * this.params.pageSize) { this.status = "nomore" } console.log('list', JSON.parse(JSON.stringify(this.list))); @@ -334,8 +346,11 @@ url: '/pages/charge/constructionMaintenance/detail?objData=' + JSON.stringify(item) }) }, - handleOpen(item, type) { - this.IgnitionID = item.id; + handleOpen(item, type, name) { + console.log("item",item) + this.title = name; + this.itemData = item; + // this.IgnitionID = item.id; this.btnType = type; this.$refs.popUpFillInRef.open(); }, diff --git a/pages/charge/ignitionMaintenance/detail.vue b/pages/charge/ignitionMaintenance/detail.vue index fbbd889..d1018a7 100644 --- a/pages/charge/ignitionMaintenance/detail.vue +++ b/pages/charge/ignitionMaintenance/detail.vue @@ -89,7 +89,7 @@ name: "点火确认", value: "", key: "ignCnfStatusCode", - dict:"sys_mc_ign_status" + dict:"sys_yes_no" }, { name: "点火时间", value: "", @@ -119,6 +119,11 @@ this.objData = JSON.parse(data.objData); console.log('传递data', JSON.parse(JSON.stringify(this.objData))); this.dataList = this.$assignValues(this.objData, this.dataList); + // 如果已点火则手动删除未点火原因 + const hasIgnCnfStatusCodeY = this.dataList.some(item => item.key === 'ignCnfStatusCode' && item.value === 'Y'); + if (hasIgnCnfStatusCodeY) { + this.dataList = this.dataList.filter(item => item.key !== 'nIgnRsn'); + } } }, methods: { diff --git a/pages/charge/ignitionMaintenance/index.vue b/pages/charge/ignitionMaintenance/index.vue index d512aaf..2def47e 100644 --- a/pages/charge/ignitionMaintenance/index.vue +++ b/pages/charge/ignitionMaintenance/index.vue @@ -67,7 +67,7 @@ 查看详情 + v-if="item.statusCode === 'MAINTENANCE'"> 点火维护 @@ -78,7 +78,7 @@ - @@ -100,6 +100,7 @@ getMcIgnitionList, mcIgnitionMaintenance } from '@/api/charge.js' + import * as dd from 'dingtalk-jsapi' import popUpFillIn from '@/components/popUpFillIn/popUpFillIn.vue' export default { components: { @@ -159,7 +160,8 @@ key: 'status', dict: 'sys_mc_ign_status' }, - ] + ], + itemData:{}, } }, computed: { @@ -193,12 +195,13 @@ }, 500); }, onShow() { + // this.getCompanyCascader(); + // this.initData(); + }, + onLoad() { this.getCompanyCascader(); this.initData(); }, - // onLoad() { - // this.initData() - // }, methods: { async initData() { let { @@ -242,6 +245,7 @@ console.log(item) this.userCode = item.userCode; this.IgnitionID = item.id; + this.itemData = item; this.$refs.popUpFillInRef.open(); }, async openPicker(data) { diff --git a/pages/charge/visitsAndFees/createaVisit.vue b/pages/charge/visitsAndFees/createaVisit.vue index db56bd5..7b04f84 100644 --- a/pages/charge/visitsAndFees/createaVisit.vue +++ b/pages/charge/visitsAndFees/createaVisit.vue @@ -28,7 +28,7 @@ {{getDictDataLabel(item.dict,model[item.key])}} @@ -323,7 +323,7 @@ validator: (rule, value, callback) => { return uni.$u.test.mobile(value); }, - message: '手机号码不正确', + message: '联系电话不正确', trigger: ['change', 'blur'], }], address: [{ @@ -385,7 +385,7 @@ validator: (rule, value, callback) => { return uni.$u.test.mobile(value); }, - message: '联系电话不正确', + message: '决策人联系电话不正确', trigger: ['change', 'blur'], }], isCharged: [{ @@ -509,10 +509,11 @@ key: "company" }, { label: '村(小区)', - placeholder: "请选择或输入", + placeholder: "请选择", type: "select", required: true, - key: "vlgOrCmty" + key: "vlgOrCmty", + disabled:true }, { label: '户名', placeholder: "请选择或输入", @@ -977,7 +978,8 @@ } let col = result.data.map(item => ({ value: item.vlgOrCmty, - label: item.vlgOrCmty + label: item.vlgOrCmty, + urbRurCls:item.urbRurCls })); this.columns = [col]; } else if (item.key === 'userName') { @@ -1049,7 +1051,8 @@ console.log("确认", e); if (this.currentName === 'vlgOrCmty') { this.emptyFill(2); - this.model[this.currentName] = e.value[0].value + this.model[this.currentName] = e.value[0].value; + this.model.urbRurCls = e.value[0].urbRurCls; } else if (this.currentName === 'userName') { this.emptyFill(); let values = e.values[0][0] @@ -1327,7 +1330,9 @@ this.copyModel.isIntent = this.copyModel.isIntent === '是' ? 'Y' : 'N'; this.copyModel.isVisited = this.copyModel.isVisited === '是' ? 'Y' : 'N'; this.copyModel.hasDm = this.copyModel.hasDm === '是' ? 'Y' : 'N'; - this.copyModel.entryTime = this.copyModel.entryTime + ' 00:00:00'; + if (!this.copyModel.entryTime.includes(' 00:00:00')) { + this.copyModel.entryTime += ' 00:00:00'; + } // this.copyModel.attachmentFile = this.attachmentList.map(item => item.uuid).join(","); }, storingData() { @@ -1352,6 +1357,7 @@ uni.$u.toast('发起成功'); this.storingData(); setTimeout(() => { + uni.$emit('update'); this.$goBack(); }, 1000) } @@ -1377,6 +1383,7 @@ uni.$u.toast('修改成功'); this.storingData(); setTimeout(() => { + uni.$emit('update'); this.$goBack(); }, 1000) } @@ -1408,6 +1415,7 @@ if (result.code === 200) { uni.$u.toast('异动成功'); setTimeout(() => { + uni.$emit('update'); that.$goBack(); }, 1000) } else { diff --git a/pages/charge/visitsAndFees/detail.vue b/pages/charge/visitsAndFees/detail.vue index d2c150c..86058f9 100644 --- a/pages/charge/visitsAndFees/detail.vue +++ b/pages/charge/visitsAndFees/detail.vue @@ -219,17 +219,22 @@ this.objData = JSON.parse(data.objData); console.log('传递data', JSON.parse(JSON.stringify(this.objData))); this.dataList = this.$assignValues(this.objData, this.dataList); - await getByUuid(this.objData.fieldPhotoFile).then((res)=>{ - this.objData.fieldPhotoFile=[{ - type:'photoList', - url:res.data.url, - fileId:res.data.uuid - }]; - }) + if(this.objData.fieldPhotoFile){ + await getByUuid(this.objData.fieldPhotoFile).then((res)=>{ + this.objData.fieldPhotoFile=[{ + type:'photoList', + url:res.data.url, + fileId:res.data.uuid + }]; + }) + }else{ + this.objData.fieldPhotoFile = [] + } this.bfDataList = this.$assignValues(this.objData, this.bfDataList); + // console.log("拜访信息",this.bfDataList); this.jcrDataList = this.$assignValues(this.objData, this.jcrDataList); this.sfDataList = this.$assignValues(this.objData, this.sfDataList); - console.log("收费信息", this.sfDataList); + // console.log("收费信息", this.sfDataList); this.dataList.map(item => { if (item.key === 'address') { item.value = diff --git a/pages/charge/visitsAndFees/index.vue b/pages/charge/visitsAndFees/index.vue index 5502366..8b80a12 100644 --- a/pages/charge/visitsAndFees/index.vue +++ b/pages/charge/visitsAndFees/index.vue @@ -108,12 +108,12 @@ 更多操作 - - 修改 - 查看详情 + + 修改 + 拒绝 @@ -179,6 +179,7 @@ getCompanyCascader, cancelMcVisit } from '@/api/charge.js' + import * as dd from 'dingtalk-jsapi' import popUpComponent from '@/components/popUpComponent/popUpComponent.vue' export default { components: { @@ -314,10 +315,15 @@ uni.stopPullDownRefresh(); }, 500); }, - onShow() { + onLoad() { this.initData(); this.getCompanyCascader(); + // 监听其他页面返回后刷新 + uni.$on('update', function(data) { + this.initData(); + }) }, + onShow() {}, methods: { selectConfirm(e) { console.log('打印selectConfirm', e); @@ -412,7 +418,7 @@ let time = this.$u.timeFormat(e.value, 'yyyy'); console.log("选择时间", time); // this.model[this.currentName] = time; - if(time < this.params.startFiscalYear){ + if (time < this.params.startFiscalYear) { uni.$u.toast('结束财年需大于开始财年'); return; } @@ -495,7 +501,8 @@ const { statusCode } = item; - return statusCode === 'APPROVED' && this.$checkPermi(['schsf:mcVisit:modification']) + return statusCode === 'APPROVED' && this.$checkPermi(['schsf:mcVisit:modification']) && (item.ticketType === + '2' || item.ticketType === '3') }, // 作废权限 cancelPermission(item) { @@ -506,14 +513,14 @@ bfColorStatus(status, type) { const bgColorMap = { '3': '#EFF1FD', - '2': '#FFF6E6', - '1': '#CF000D', + '2': '#EFF1FD', + '1': '#FFF6E6', '0': '#F5F5F7', }; const textColorMap = { '3': '#5875EB', - '2': '#FFA500', - '1': '#ffffff', + '2': '#5875EB', + '1': '#FFAD00', '0': '#999DB0', }; @@ -559,7 +566,7 @@ } else { this.list = rows; } - if(this.total < this.params.pageNum * this.params.pageSize){ + if (this.total < this.params.pageNum * this.params.pageSize) { this.status = "nomore" } this.total = total; @@ -673,6 +680,7 @@ this.$modal.confirm('您当前确定要退出吗?', '退出登录').then(() => { //钉钉直接退出微应用 if (this.$isDing) { + console.log("退出钉钉") dd.biz.navigation.close({ onSuccess: function(result) { console.log(result, 'result') @@ -688,8 +696,8 @@ }) }) } - }).catch(() => { - console.log("取消"); + }).catch((e) => { + console.log("取消", e); }); } } diff --git a/pages/login/mobile.vue b/pages/login/mobile.vue index 6537d52..fa48f9e 100644 --- a/pages/login/mobile.vue +++ b/pages/login/mobile.vue @@ -130,8 +130,8 @@ this.isDing = true; dd.ready(() => { dd.runtime.permission.requestAuthCode({ - // corpId: "dinge6053c157358448735c2f4657eb6378f", - corpId: "dingf2f9115915afcb54a39a90f97fcb1e09", + corpId: "dinge6053c157358448735c2f4657eb6378f", + // corpId: "dingf2f9115915afcb54a39a90f97fcb1e09", onSuccess: (info) => { that.$store.dispatch('Login', { type: 2, @@ -141,17 +141,16 @@ //获取全部字典信息 保存至store that.$store.dispatch('loadDictDatas') setTimeout(() => { - uni.switchTab({ - url: '/pages/market/index' - }) - // uni.navigateTo({ - // url: '/pages/market/total' + // uni.switchTab({ + // url: '/pages/market/index' // }) + uni.navigateTo({ + url: '/pages/login/workbench' + }) }, 300) }).catch(err => { // alert(JSON.stringify(err)) - console.log(err); - // uni.$u.toast('非钉钉内部账号'); + console.log(123,err); setTimeout(() => { that.isDing = false; }, 500) @@ -159,10 +158,13 @@ }, onFail: (err) => { that.isDing = false - console.log(err); + // uni.$u.toast(err.errorMessage); } }) }) + dd.error((e)=>{ + console.log('ddError',e); + }) } }, //记住账号密码 diff --git a/pages/login/workbench.vue b/pages/login/workbench.vue index 9576563..6f2bb2d 100644 --- a/pages/login/workbench.vue +++ b/pages/login/workbench.vue @@ -7,7 +7,8 @@ 市场洞察平台 - + 市场化收费工具 @@ -31,25 +32,34 @@ }, onLoad() { - + if (!this.validate()) { + this.handleClick('insight'); + // setTimeout(()=>{ + // uni.switchTab({ + // url: '/pages/market/index' + // }) + // },500) + } }, methods: { // 验证是否需要显示工具菜单 - validate(){ - let toolPermissions = ['schsf:mcVisit:list','schsf:mcIgnition:list','schsf:mcConstruction:list'] + validate() { + let toolPermissions = ['schsf:mcVisit:list', 'schsf:mcIgnition:list', 'schsf:mcConstruction:list'] console.log(this); // 假设 this.$checkPermi 是一个返回布尔值的方法 let hasPermission = toolPermissions.some(permission => { - return this.$checkPermi([permission]); + return this.$checkPermi([permission]); }); return hasPermission }, handleClick(workName) { console.log(workName); - this.$store.dispatch('setTab', {data: workName}); + this.$store.dispatch('setTab', { + data: workName + }); let tabList = this.$store.state.tabbar.list let urls = tabList[0].pagePath - console.log("跳转",urls); + console.log("跳转", urls); setTimeout(() => { uni.switchTab({ url: `/${urls}` -- libgit2 0.21.2