测量计划报验单web页面

main
chenglifeng 6 months ago
parent 7bc8065081
commit e28a637d58
  1. 2
      app/src/main/java/com/project/survey/logic/viewmodel/ProjectViewModel.kt
  2. 2
      app/src/main/java/com/project/survey/network/Api.kt
  3. 25
      app/src/main/java/com/project/survey/ui/pointmeasure/PointMeasureListActivity.kt

@ -82,7 +82,7 @@ class ProjectViewModel : BaseViewModel() {
val res = api.fetchMeasureDataList( val res = api.fetchMeasureDataList(
tableCode = type, tableCode = type,
funcCode = if (type == Constants.TYPE_BD_CLJH) Constants.TYPE_BD_CLJH else "${Constants.TYPE_BD_CLGZ_GCJL}_ZB", funcCode = if (type == Constants.TYPE_BD_CLJH) Constants.TYPE_BD_CLJH else "${Constants.TYPE_BD_CLGZ_GCJL}_ZB",
j_qurey = query, j_query = query,
page = page page = page
) )
if (res.success) { if (res.success) {

@ -150,7 +150,7 @@ interface Api {
@Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID), @Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID),
@Field("tableCode") tableCode: String, @Field("tableCode") tableCode: String,
@Field("funcCode") funcCode: String, @Field("funcCode") funcCode: String,
@Field("j_query") j_qurey: String?, @Field("j_query") j_query: String?,
@Field("page") page: Int, @Field("page") page: Int,
@Field("limit") limit: Int = 1000, @Field("limit") limit: Int = 1000,
@Field("start") start: Int = 0 @Field("start") start: Int = 0

@ -1,10 +1,14 @@
package com.project.survey.ui.pointmeasure package com.project.survey.ui.pointmeasure
import android.net.Uri
import androidx.activity.viewModels import androidx.activity.viewModels
import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.MaterialDialog
import com.bingce.surveyor.agentweb.AgentWebActivity
import com.project.survey.BuildConfig
import com.project.survey.R import com.project.survey.R
import com.project.survey.constants.AdapterConstants import com.project.survey.constants.AdapterConstants
import com.project.survey.constants.Constants import com.project.survey.constants.Constants
import com.project.survey.constants.SPConstants
import com.project.survey.databinding.ActivityPointMeasureListBinding import com.project.survey.databinding.ActivityPointMeasureListBinding
import com.project.survey.extend.smartDismiss import com.project.survey.extend.smartDismiss
import com.project.survey.extend.toast import com.project.survey.extend.toast
@ -16,6 +20,7 @@ import com.project.survey.ui.pointmeasure.adapter.PointMeasureListAdapter
import com.project.survey.ui.pointmeasure.measure.PointSurveyNewActivity import com.project.survey.ui.pointmeasure.measure.PointSurveyNewActivity
import com.project.survey.util.ActivityNavUtil import com.project.survey.util.ActivityNavUtil
import com.project.survey.util.LogoutUtil import com.project.survey.util.LogoutUtil
import com.project.survey.util.SPUtils
import com.scwang.smart.refresh.layout.api.RefreshLayout import com.scwang.smart.refresh.layout.api.RefreshLayout
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener
@ -92,7 +97,7 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
} }
// 生成报验单 // 生成报验单
viewModel.createInspectionReportResponse.observe(this) { viewModel.createInspectionReportResponse.observe(this) {
toast(it.CLJH_WORKSTATUS) navigation2BaoYanDan(it.BD_CLJH_ID)
} }
// //
viewModel.updateMeasureWorkStatusResponse.observe(this) { viewModel.updateMeasureWorkStatusResponse.observe(this) {
@ -120,7 +125,11 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
// 生成报验单 // 生成报验单
adapter.addOnItemChildClickListener(R.id.tvGenerateForm) { adapter, _, position -> adapter.addOnItemChildClickListener(R.id.tvGenerateForm) { adapter, _, position ->
adapter.getItem(position)?.let { bean -> adapter.getItem(position)?.let { bean ->
viewModel.createInspectionReport(bean.BD_CLJH_ID) if ("报验单已生成" == bean.CLJH_WORKSTATUS){
navigation2BaoYanDan(bean.BD_CLJH_ID)
} else {
viewModel.createInspectionReport(bean.BD_CLJH_ID)
}
} }
} }
// 结束测量 // 结束测量
@ -157,6 +166,18 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
viewModel.fetchMeasureDataList(type, 1, searchContent) viewModel.fetchMeasureDataList(type, 1, searchContent)
} }
/**
* 报验单 Web 页面
*/
private fun navigation2BaoYanDan(workId: String){
// http://10.190.183.37/app/micro/func/#/pages/func/form/BD_CLJH/{workId}?authorization={登录token}&appId=2024-1104-1503-4541
val token = SPUtils.getString(SPConstants.TOKEN)
val url =
BuildConfig.BASE_URL + "app/micro/func/#/pages/func/form/BD_CLJH/${workId}?authorization=${token}&appId=2024-1104-1503-4541"
AgentWebActivity.navigation2(this, Uri.parse(url))
}
// override fun onRefresh(refreshLayout: RefreshLayout) { // override fun onRefresh(refreshLayout: RefreshLayout) {
// currentPage = 1 // currentPage = 1
// fetchData() // fetchData()

Loading…
Cancel
Save