完成 不合格

master
wangh 1 year ago
parent 3c0dcc676c
commit 4406b63b77

@ -17,6 +17,15 @@
android:theme="@style/Theme.Jingyuanmes"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".check.CheckDisposalActivity"
android:exported="true">
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
</activity>
<activity
android:name=".check.CheckSelectDetalActivity"
android:exported="false" />
@ -65,11 +74,11 @@
<activity
android:name=".HomePageActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".store.MaterialOutListActivity"

@ -30,7 +30,7 @@ public class BaseActivity extends AppCompatActivity {
public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private MyReceiver myReceiver;
public String handle = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjdmNzc2OTQwLWQ3ZTMtNGU3NC1hM2JkLTc3NzlhMmU4MDY4MCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.CJbA82A3QaepkA_qo2agavyqs_38b45yqcbkvdRUlGoMcBMB1SEd6mL-m2wzHKI1BTfeWmCnURbSoZdOllxzGw";
public String handle = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjJlZDdiYmMyLWEyZDQtNGFkOS04OGQzLWViZGE5OGJiZTQ2NyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.M_ELTmvE5fM8nafH9XWMmVlFqTN23dUpvrgzSwozx52GfdVprzzPcZ-UvY_nCobVlR2lCQnzG2k5_vKWm_Qfnw";
public Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {

@ -0,0 +1,16 @@
package com.example.jingyuan_mes.check;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.jingyuan_mes.R;
public class CheckDisposalActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_check_disposal);
}
}

@ -3,6 +3,9 @@ package com.example.jingyuan_mes.check;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;
import androidx.databinding.DataBindingUtil;
@ -26,19 +29,29 @@ public class CheckSelectActivity extends BaseActivity implements ItemClickCall {
private List<CheckResult> list;
private CheckSelectAdapter adapter;
private Intent intent1;
private String title;
private boolean activityType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityCheckSelectBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_check_select);
adapter = new CheckSelectAdapter(this, this);
binding.setAdapter(adapter);
var intent = getIntent();
title = intent.getStringExtra("title");
var title = getIntent().getStringExtra("title");
binding.setTitle(title);
intent1 = new Intent(this, title.equals("物料质检列表")?CheckSelectDetalActivity.class:CheckSelectDetalActivity.class);
activityType = title.equals("物料质检列表");
intent1 = new Intent(this, activityType ? CheckSelectDetalActivity.class : CheckDisposalActivity.class);
binding.checkSelectItemSelect.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Log.e("TAG", "onItemSelected:"+position );
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
@Override
@ -46,7 +59,7 @@ public class CheckSelectActivity extends BaseActivity implements ItemClickCall {
super.onResume();
OkGo.<MyResult>get(url + "/qms/mobile/getCheckResults").tag(this)
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.params("checkStatus", title.equals("物料质检列表")?null:"3")
.params("checkStatus",activityType ? null : "3")
.execute(new MyRecultCall(dialog, this) {
@SuppressLint("NotifyDataSetChanged")
@Override
@ -76,10 +89,15 @@ public class CheckSelectActivity extends BaseActivity implements ItemClickCall {
var checkMode = checkResult.getCheckModeText();
var checkSample = checkResult.getCheckSample();
var materialBatch = checkResult.getMaterialBatch();
intent1.putExtra("checkResultId",checkResultId);
intent1.putExtra("checkMode",checkMode);
intent1.putExtra("checkSample",checkSample);
intent1.putExtra("materialBatch",materialBatch);
intent1.putExtra("checkResultId", checkResultId);
intent1.putExtra("checkMode", checkMode);
intent1.putExtra("checkSample", checkSample);
intent1.putExtra("materialBatch", materialBatch);
intent1.putExtra("materialCode",checkResult.getMaterialCode());
intent1.putExtra("materialName",checkResult.getMaterialName());
startActivity(intent1);
}
}

@ -132,7 +132,17 @@ public class CheckResult extends BaseObservable {
this.checkRuleId = checkRuleId;
}
/**
* 1,2,3,4
* @return
*/
public String getCheckRuleType() {
switch (checkRuleType){
case "1" : return "来料检验";
case "2" : return "半成品检验";
case "3" : return "成品检验";
case "4" : return "工序检验";
}
return checkRuleType;
}

@ -0,0 +1,228 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="title"
type="String" />
<variable
name="vm"
type="com.example.jingyuan_mes.entity.check.CheckResult" />
<variable
name="adapter"
type="com.example.jingyuan_mes.adapter.check.CheckWorkAdapter" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
tools:context=".check.CheckDisposalActivity">
<include
layout="@layout/toolbar"
app:title='@{title??"不合格处置"}' />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginStart="40dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="40dp">
<TextView
style="@style/item_title"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="检验方式:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text='@{vm.checkMode==null?"":(vm.checkMode+"("+vm.checkSample+"%)")}' />
<TextView
style="@style/item_title"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="检验类型:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{vm.checkRuleType}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginStart="40dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="40dp">
<TextView
style="@style/item_title"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="物料编号:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{vm.materialCode}" />
<TextView
style="@style/item_title"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="物料名称:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{vm.materialName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginStart="40dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="40dp">
<TextView
style="@style/item_title"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="批次数量:" />
<TextView
style="@style/item_info"
android:layout_width="95dp"
android:layout_height="match_parent"
android:text="@{vm.checkMode}" />
<TextView
style="@style/item_title"
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="质检通过数量:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{vm.checkStatus}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginStart="40dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="40dp">
<TextView
style="@style/item_title"
android:layout_width="110dp"
android:layout_height="match_parent"
android:text="质检不通过数量:" />
<TextView
style="@style/item_info"
android:layout_width="55dp"
android:layout_height="match_parent"
android:text="@{vm.checkStatus}" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginStart="8dp"
android:layout_marginTop="9dp"
android:layout_marginEnd="8dp"
android:background="@color/item_bg" />
<TextView
style="@style/item_title"
android:layout_width="109dp"
android:layout_height="35dp"
android:layout_marginStart="40dp"
android:text="不合格情况描述:"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:background="@drawable/san_text_bg"
android:gravity="left"
android:padding="5dp"
android:text="12312"
android:textSize="14sp" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginStart="8dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="8dp"
android:background="@color/item_bg" />
<TextView
style="@style/item_title"
android:layout_width="109dp"
android:layout_height="35dp"
android:layout_marginStart="40dp"
android:text="不合格情况描述:"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginStart="8dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="8dp"
android:background="@color/item_bg" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
<Button
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_margin="20dp"/>
</LinearLayout>
</layout>

@ -26,11 +26,14 @@
app:title='@{title??"物料检验列表"}' />
<Spinner
android:id="@+id/checkSelectItemSelect"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:entries="@array/checktype"
android:background="@drawable/spinner_bg" />
<androidx.recyclerview.widget.RecyclerView

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="151dp"
android:background="@color/white"
android:paddingTop="5dp">
<TextView
android:id="@+id/textView"
style="@style/item_title"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_marginStart="40dp"
android:text="处理人1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView2"
style="@style/item_title"
android:layout_width="50dp"
android:layout_height="30dp"
android:text="处理人"
app:layout_constraintStart_toEndOf="@+id/textView"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
style="@style/item_title"
android:layout_width="140dp"
android:layout_height="30dp"
android:text="2024-111-11 11-11-11"
app:layout_constraintStart_toEndOf="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/editText"
android:layout_width="0dp"
android:layout_height="100dp"
android:background="@drawable/san_text_bg"
android:gravity="left"
android:padding="5dp"
android:text="12312"
android:layout_marginRight="40dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="@+id/textView"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:background="@color/item_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="checktype">
<item>选择检验类型</item>
<item>来料检验</item>
<item>半成品检验</item>
<item>成品检验</item>
<item>工序检验</item>
</string-array>
</resources>

@ -20,6 +20,12 @@
<item name="android:textColor">@color/black</item>
<item name="android:background">@drawable/text_bg</item>
</style>
<style name="item_info">
<item name="android:textSize">13sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
<item name="android:background">@drawable/text_bg</item>
</style>
<style name="item_title">
<item name="android:textSize">13sp</item>

Loading…
Cancel
Save