|
@@ -1,19 +1,21 @@
|
|
|
import { AddAndSubtractComp } from '../../common/component/AddAndSubtractComp'
|
|
|
+import JGRequest from '../../common/util/request/Request'
|
|
|
|
|
|
@Component
|
|
|
export struct RecordItemView {
|
|
|
- @State recordArray: RecordItem[] = [
|
|
|
- {unit: 'cm', standardValue: 10, upperLimit: 100, lowerLimit: 5, actualValue: 0},
|
|
|
- {unit: 'cm', standardValue: 10, upperLimit: 10.3, lowerLimit: 9.8, actualValue: 0},
|
|
|
- {unit: 'cm', standardValue: 10, upperLimit: 10.3, lowerLimit: 9.8, actualValue: 0},
|
|
|
- {unit: 'cm', standardValue: 10, upperLimit: 10.3, lowerLimit: 9.8, actualValue: 0},
|
|
|
- {unit: 'cm', standardValue: 10, upperLimit: 10.3, lowerLimit: 9.8, actualValue: 0},
|
|
|
- {unit: 'cm', standardValue: 10, upperLimit: 10.3, lowerLimit: 9.8, actualValue: 0},
|
|
|
- {unit: 'cm', standardValue: 10, upperLimit: 10.3, lowerLimit: 9.8, actualValue: 0},
|
|
|
- ]
|
|
|
+ @State recordArray: RecordItem[] = []
|
|
|
|
|
|
- // todo 查询数据
|
|
|
- aboutToAppear() {
|
|
|
+ // 生产过程id(开工信息id)
|
|
|
+ processId: number
|
|
|
+ // 工序id
|
|
|
+ operationId: number
|
|
|
+
|
|
|
+ async aboutToAppear() {
|
|
|
+ this.recordArray = await JGRequest.post("/api/v1/process/opRecord/list", {
|
|
|
+ // todo 参数修改
|
|
|
+ "operationId": 129,
|
|
|
+ "processId": 1
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
build() {
|
|
@@ -34,17 +36,17 @@ export struct RecordItemView {
|
|
|
.opacity($r('app.float.process_step_font_opacity'))
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
Row().height('12%')
|
|
|
- Text('标准值:' + item.standardValue)
|
|
|
+ Text('标准值:' + item.standard)
|
|
|
.fontSize($r('app.float.process_card_small_font_size'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.process_step_font_opacity'))
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
- Text('上限值:' + item.upperLimit)
|
|
|
+ Text('上限值:' + item.upper)
|
|
|
.fontSize($r('app.float.process_card_small_font_size'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.process_step_font_opacity'))
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
- Text('下线值:' + item.lowerLimit)
|
|
|
+ Text('下限值:' + item.lower)
|
|
|
.fontSize($r('app.float.process_card_small_font_size'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.process_step_font_opacity'))
|
|
@@ -64,30 +66,35 @@ export struct RecordItemView {
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
Row() {
|
|
|
AddAndSubtractComp({
|
|
|
- inputNum: item.actualValue,
|
|
|
+ inputNum: item.realValue,
|
|
|
obj: item,
|
|
|
- editPropertyName: 'actualValue',
|
|
|
- upperLimit: item.upperLimit,
|
|
|
- lowerLimit: item.lowerLimit,
|
|
|
+ editPropertyName: 'realValue',
|
|
|
+ upperLimit: item.upper,
|
|
|
+ lowerLimit: item.lower,
|
|
|
addFunction: ()=>{
|
|
|
- item.actualValue++
|
|
|
+ item.realValue++
|
|
|
this.recordArray[index] = {
|
|
|
unit: item.unit,
|
|
|
- standardValue: item.standardValue,
|
|
|
- upperLimit: item.upperLimit,
|
|
|
- lowerLimit: item.lowerLimit,
|
|
|
- actualValue: item.actualValue
|
|
|
+ standard: item.standard,
|
|
|
+ upper: item.upper,
|
|
|
+ lower: item.lower,
|
|
|
+ realValue: item.realValue
|
|
|
}
|
|
|
+ this.updateRealValue(index)
|
|
|
},
|
|
|
subFunction: ()=>{
|
|
|
- item.actualValue--
|
|
|
+ item.realValue--
|
|
|
this.recordArray[index] = {
|
|
|
unit: item.unit,
|
|
|
- standardValue: item.standardValue,
|
|
|
- upperLimit: item.upperLimit,
|
|
|
- lowerLimit: item.lowerLimit,
|
|
|
- actualValue: item.actualValue
|
|
|
+ standard: item.standard,
|
|
|
+ upper: item.upper,
|
|
|
+ lower: item.lower,
|
|
|
+ realValue: item.realValue
|
|
|
}
|
|
|
+ this.updateRealValue(index)
|
|
|
+ },
|
|
|
+ editFunction: ()=>{
|
|
|
+ this.updateRealValue(index)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -115,12 +122,51 @@ export struct RecordItemView {
|
|
|
.width('100%')
|
|
|
.height('100%')
|
|
|
}
|
|
|
+
|
|
|
+ updateRealValue(index: number) {
|
|
|
+ JGRequest.post('/api/v1/process/opRecord/update', {
|
|
|
+ "id": this.recordArray[index].id,
|
|
|
+ "realValue": this.recordArray[index].realValue,
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
class RecordItem {
|
|
|
- unit: string
|
|
|
- standardValue: number
|
|
|
- upperLimit: number
|
|
|
- lowerLimit: number
|
|
|
- public actualValue: number
|
|
|
+ // 创建时间
|
|
|
+ created?: string
|
|
|
+ // 创建人
|
|
|
+ creator?: string
|
|
|
+ // 删除标识
|
|
|
+ deleted?: number
|
|
|
+ // 部门ID
|
|
|
+ deptId?: string
|
|
|
+ // 主键id
|
|
|
+ id?: number
|
|
|
+ // 下限值
|
|
|
+ lower?: number
|
|
|
+ // 工序记录项id
|
|
|
+ operationRecordId?: string
|
|
|
+ // 组织ID
|
|
|
+ orgId?: string
|
|
|
+ // 生产过程id
|
|
|
+ processId?: string
|
|
|
+ // 实际值
|
|
|
+ realValue?: number
|
|
|
+ // 排序号
|
|
|
+ sortNum?: number
|
|
|
+ // 标准值
|
|
|
+ standard?: number
|
|
|
+ // 步骤id
|
|
|
+ stepInstanceId?: string
|
|
|
+ // 记录项内容
|
|
|
+ thName?: string
|
|
|
+ // 单位
|
|
|
+ unit?: string
|
|
|
+ // 修改时间
|
|
|
+ updated?: string
|
|
|
+ // 上次修改人
|
|
|
+ updator?: string
|
|
|
+ // 上限值
|
|
|
+ upper?: number
|
|
|
}
|