From caa99433f18b2e30ad2068c6692f46ba6ae838cc Mon Sep 17 00:00:00 2001 From: THK3121 Date: Fri, 1 Sep 2023 21:40:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/property.js | 10 ++ pages.json | 9 ++ subpkg/contract/contract.vue | 49 +++--- subpkg/property/agencyList.vue | 2 +- subpkg/property/chosseCompany.vue | 255 +++++++++++++++++++----------- subpkg/property/contractList.vue | 90 +++++++++++ subpkg/property/index.vue | 108 +++++++++---- subpkg/property/success.vue | 11 +- subpkg/property/vehicle_a.vue | 196 ++++++++++++++++------- utils/oahttp.js | 6 +- 10 files changed, 517 insertions(+), 219 deletions(-) create mode 100644 subpkg/property/contractList.vue diff --git a/api/property.js b/api/property.js index 2acb91e..c3621f1 100644 --- a/api/property.js +++ b/api/property.js @@ -14,6 +14,9 @@ export const upVehicleApi = (data) => oahttp.post('/vehicle/rentApply', data) export const applycarApi = (data) => oahttp.post('/vehicle/rentApply', data) // 显示轨迹 export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data) +// 当前车辆位置信息 +// export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data) +// api / getCarLocal // 签约列表 export const getAgencyListApi = (data) => oahttp.get('/vehicle/rentApplyList', data) // 签约公司详情 @@ -28,6 +31,13 @@ export const sendcontractApi = (data) => oahttp.post('/vehicle/initiatingRentCar export const overruleApi = (data) => oahttp.post('/vehicle/rejectRentApply', data) // 小组公司详情 export const villageCompanyApi = (data) => oahttp.get('/vehicle/villageCompanyIndex', data) + +// 重新发送短信 +export const sendMsgApi = (data) => oahttp.post('/vehicle/sendSmsAgain', data) +// 解约 +export const cancelContractApi = (data) => oahttp.post('/vehicle/cancelContract', data) +// 镇街公司合同列表 +export const ContractListApi = (data) => oahttp.get('/vehicle/townCompanyContractList', data) // 资产详情 // export const getpropertyDetil = (data) => oahttp.get('/lstDetail', data) diff --git a/pages.json b/pages.json index 98be749..9e6bf10 100644 --- a/pages.json +++ b/pages.json @@ -562,6 +562,15 @@ "navigationBarTextStyle": "white" } + }, { + "path": "property/contractList", + "style": { + "navigationBarTitleText": "合同列表", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#0122C7", + "navigationBarTextStyle": "white" + } + }, { "path": "buyShare/buyShare", "style": { diff --git a/subpkg/contract/contract.vue b/subpkg/contract/contract.vue index 340c46d..31d7158 100644 --- a/subpkg/contract/contract.vue +++ b/subpkg/contract/contract.vue @@ -12,7 +12,8 @@ - + 电子合同 @@ -149,30 +150,30 @@ }, methods: { navTo(url) { - if(url){ - uni.showLoading({ - title: '加载中', - mask: true - }); - uni.navigateTo({ - url: url, - success() { - uni.hideLoading() - } - }) - }else Toast('暂未开放') + if (url) { + uni.showLoading({ + title: '加载中', + mask: true + }); + uni.navigateTo({ + url: url, + success() { + uni.hideLoading() + } + }) + } else Toast('暂未开放') }, - navToContract (contract_no) { - download_file({ - applyNo: contract_no - }).then(res => { - if (res.code != 1) { - Toast(res.msg||'合同未签订') - } - uni.navigateTo({ - url: `/subpkg/pdfView/pdfView?url=${res.data.url}` - }) - }) + navToContract(contract_no) { + download_file({ + applyNo: contract_no + }).then(res => { + if (res.code != 1) { + Toast(res.msg || '合同未签订') + } + uni.navigateTo({ + url: `/subpkg/pdfView/pdfView?url=${res.data.url}` + }) + }) }, initLoadConfig() { this.loadConfig.page = 1; diff --git a/subpkg/property/agencyList.vue b/subpkg/property/agencyList.vue index e449f60..e452c38 100644 --- a/subpkg/property/agencyList.vue +++ b/subpkg/property/agencyList.vue @@ -12,7 +12,7 @@ - {{item.village_company_name}}提出租赁车辆一辆 + {{item.company_b_name}}提出租赁车辆一辆 diff --git a/subpkg/property/chosseCompany.vue b/subpkg/property/chosseCompany.vue index 6b2a47e..1641602 100644 --- a/subpkg/property/chosseCompany.vue +++ b/subpkg/property/chosseCompany.vue @@ -1,42 +1,62 @@ \ No newline at end of file diff --git a/utils/oahttp.js b/utils/oahttp.js index b61542c..97c06bb 100644 --- a/utils/oahttp.js +++ b/utils/oahttp.js @@ -51,10 +51,8 @@ function baseRequestTwo(url, method, data, { url: Url + '/api' + url, method: method || 'GET', header: { - ...header, - ...{ - 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' - } + ...header + }, data: method != 'GET' ? data || {} : {}, params: method == 'GET' ? data : {}, From 36084196a5d7ce337f10629adf23d96eb63e7b2d Mon Sep 17 00:00:00 2001 From: THK3121 Date: Sat, 2 Sep 2023 13:18:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B5=84=E4=BA=A7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subpkg/property/chosseCompany.vue | 94 +++++++++++++++++++------------ subpkg/property/index.vue | 37 ++++++------ subpkg/property/vehicle_a.vue | 18 ++++-- 3 files changed, 87 insertions(+), 62 deletions(-) diff --git a/subpkg/property/chosseCompany.vue b/subpkg/property/chosseCompany.vue index 1641602..cffd870 100644 --- a/subpkg/property/chosseCompany.vue +++ b/subpkg/property/chosseCompany.vue @@ -2,12 +2,12 @@ - {{dataList.create_time.slice(0,10)}} 提出申请 + {{dataList.create_time}} 提出申请 - {{dataList.create_time.slice(0,10)}} 提出解除申请 + {{dataList.create_time}} 提出解除申请 @@ -80,9 +80,9 @@ - 《租赁合同》 + 《解除合同》 - {{'2023-03-03'}} + {{dataList.create_time}} @@ -94,15 +94,13 @@ - {{dataList.status}} - + @@ -117,7 +115,8 @@ - {{ dataList.type!=2? "《租赁合同》":"解除合同" }} + {{typeFn( dataList.type) }} + {{'2023-03-03'}} @@ -130,18 +129,17 @@ - - + - @@ -170,7 +168,8 @@ export default { data() { return { - times: 5, + flag1: true, + times: 0, dataList: {}, overruleValue: "", showPop: false, @@ -181,32 +180,62 @@ } }, onLoad(options) { - // console.log(this.$route.query) - // console.log(6565) + console.log(options) getAgencyDetailApi({ id: options.id }).then(res => { // 13043214321 this.dataList = res.data.vehicleContract this.carList = res.data.vehicleRentCars - this.dataList.cars_info = JSON.parse(this.dataList.cars_info).license + this.dataList.cars_info ? this.dataList.cars_info = JSON.parse(this.dataList.cars_info).license : + "" if (this.dataList.status == 3) { uni.navigateBack() } + console.log(this.dataList.cars_info) + if (this.carList.length >= 0 || this.dataList.cars_info) { + this.flag1 = false + } + // console.log(this.dataList) }) + // console.log(this.dataList.cars_info) + + }, methods: { sendAgainFn() { + let that = this sendMsgApi({ - id: this.dataList.id + id: this.dataList.id, + }).then(res => { + Toast("发送成功") + that.times = 10 + that.timer() + // that.num = 10 }) }, sendFn() { + let that = this sendcontractApi({ id: this.dataList.id + }).then(res => { + Toast("操作成功") + that.times = 10 + that.timer() + that.dataList.status = 2 }) }, - + typeFn(status) { + if (status == 0) { + return "租赁合同" + } + if (status == 1) { + return "自有车两" + } + if (status == 2) { + "解除合同" + } + }, confirm() { // console.log(this.overruleValue) overruleApi({ @@ -225,23 +254,16 @@ let timers = setInterval(() => { that.times-- if (that.times <= 0) { - this.flag = true clearInterval(timers) } }, 1000) }, navToContract(contract_no) { - download_file({ - applyNo: contract_no - }).then(res => { - if (res.code != 1) { - Toast(res.msg || '合同未签订') - } - uni.navigateTo({ - url: `/subpkg/pdfView/pdfView?url=${res.data.url}` - }) + uni.navigateTo({ + url: `/subpkg/pdfView/pdfView?url=${contract_no}` }) + }, contractFn() { console.log(this.checked) @@ -253,14 +275,14 @@ }) this.navTo('/subpkg/property/success') }, - sendcontractFn() { - this.lg ? this.sendAgainFn() : this.sendFn() - Toast("操作成功") - this.flag = false - this.times = 10 - this.timer() - this.lg = true - }, + // sendcontractFn() { + + // // this.sendFn() + // Toast("操作成功") + // this.times = 10 + // this.timer() + + // }, navTo(url) { uni.navigateTo({ url diff --git a/subpkg/property/index.vue b/subpkg/property/index.vue index 5be847d..b1783cc 100644 --- a/subpkg/property/index.vue +++ b/subpkg/property/index.vue @@ -1,5 +1,5 @@ @@ -242,6 +243,7 @@ dataList: [], newCarNum: "", newcarTit: "", + flag: false @@ -255,17 +257,9 @@ if (type == 18) { // getvehicleDetailApi().then(res => {}) villageCompanyApi().then(res => { - if (!res.data?.id) { - - this.showLoading = false - this.step = 999 - return - } - this.showLoading = false this.datas = res.data this.step = res.data.status - switch (this.step) { case 3: uni.redirectTo({ @@ -284,7 +278,6 @@ else { getvehicleListApi().then(res => { this.datas = res.data - res.data.apply.length >= 2 ? this.applicationList = res.data.apply : this.applicationList = res .data.apply.slice(0, 2) // this.applicationList = res.data.apply @@ -308,6 +301,9 @@ // // this.applicationList=res // }) + setTimeout(() => { + this.flag = true + }) }, @@ -317,7 +313,7 @@ applycarFn() { upVehicleApi().then(res => { Toast(res.msg) - this.step = 2 + this.step = -1 }) }, // 自有车辆 @@ -325,7 +321,6 @@ upVehicleApi({ license: this.carLicense }).then(res => { - // this.show = false this.step = 2 }) // upVehicleApi({ diff --git a/subpkg/property/vehicle_a.vue b/subpkg/property/vehicle_a.vue index ad29794..e68ed27 100644 --- a/subpkg/property/vehicle_a.vue +++ b/subpkg/property/vehicle_a.vue @@ -52,15 +52,15 @@ - + - + 《租赁合同》 - {{ datas.contract.create_time}} + {{ datas.create_time}} - + 查看 @@ -102,12 +102,14 @@ import { Toast } from "../../libs/uniApi"; + import Cache from '@/utils/cache'; export default { components: { mybtn }, data() { return { + company_type: 0, showMap: true, pdfUrl: "", showPDF: false, @@ -120,6 +122,7 @@ queryData: "请选择时间", mapClass: 'custom-map', scale: 17, + showCont: false, markers: [{ id: 2, latitude: 28.8733, @@ -130,6 +133,7 @@ } }, onLoad(options) { + this.company_type = (JSON.parse(Cache.get("USER_INFO")).company.company_type) // console.log(this.$route.query.id) // if (this.$route.query.type) { // villageCompanyApi().then(res => { @@ -146,11 +150,15 @@ }) this.minDateFn() + if (this.datas.contract) { + this.showCont = true + } // console.log(date - 7) }, methods: { showContractFn(url) { + console.log(url) uni.navigateTo({ url: `/subpkg/pdfView/pdfView?url=${url}` })