173 lines
4.0 KiB
Vue
173 lines
4.0 KiB
Vue
<!--
|
|
* @Author: zwq
|
|
* @Date: 2021-11-18 14:16:25
|
|
* @LastEditors: zwq
|
|
* @LastEditTime: 2024-09-05 15:33:16
|
|
* @Description:
|
|
-->
|
|
<template>
|
|
<el-form
|
|
:model="dataForm"
|
|
:rules="dataRule"
|
|
ref="dataForm"
|
|
@keyup.enter.native="dataFormSubmit()"
|
|
label-position="top"
|
|
label-width="80px">
|
|
<el-row :gutter="20">
|
|
<el-col :span="12">
|
|
<el-form-item label="产线" prop="bindObjectName">
|
|
<el-input
|
|
style="width: 100%"
|
|
v-model="dataForm.bindObjectName"
|
|
disabled />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="所属日期" prop="recTime">
|
|
<el-date-picker
|
|
v-model="dataForm.recTime"
|
|
type="date"
|
|
value-format="timestamp"
|
|
:style="{ width: '100%' }"
|
|
disabled
|
|
placeholder="选择所属日期"></el-date-picker>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="厚度" prop="thick">
|
|
<el-input-number
|
|
:min="0"
|
|
style="width: 85%"
|
|
v-model="dataForm.thick"
|
|
clearable
|
|
placeholder="请输入厚度" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="在线速度" prop="speed">
|
|
<el-input-number
|
|
:min="0"
|
|
style="width: 85%"
|
|
v-model="dataForm.speed"
|
|
clearable
|
|
placeholder="请输入在线速度" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="掰边宽度" prop="width">
|
|
<el-input-number
|
|
:min="0"
|
|
style="width: 85%"
|
|
v-model="dataForm.width"
|
|
clearable
|
|
placeholder="请输入掰边宽度" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="拉引量" prop="inArea">
|
|
<el-input-number
|
|
:min="0"
|
|
style="width: 85%"
|
|
v-model="dataForm.inArea"
|
|
clearable
|
|
placeholder="请输入拉引量" />
|
|
(m²)
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="下片面积" prop="outArea">
|
|
<el-input-number
|
|
:min="0"
|
|
style="width: 85%"
|
|
v-model="dataForm.outArea"
|
|
clearable
|
|
placeholder="请输入下片面积" />
|
|
(m²)
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="良品率" prop="ratio">
|
|
<el-input-number
|
|
:min="0"
|
|
style="width: 85%"
|
|
v-model="dataForm.ratio"
|
|
clearable
|
|
placeholder="请输入良品率" />
|
|
(%)
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</template>
|
|
|
|
<script>
|
|
import basicAdd from '@/mixins/basic-add';
|
|
import { updatecostOriginRatioHis } from '@/api/cost/costOriginRatioHis';
|
|
|
|
export default {
|
|
mixins: [basicAdd],
|
|
props: {
|
|
nameArr: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
urlOptions: {
|
|
updateURL: updatecostOriginRatioHis,
|
|
},
|
|
dataForm: {
|
|
id: undefined,
|
|
bindObjectName: undefined,
|
|
thick: undefined,
|
|
speed: undefined,
|
|
width: undefined,
|
|
inArea: undefined,
|
|
outArea: undefined,
|
|
ratio: undefined,
|
|
recTime: undefined,
|
|
},
|
|
dataRule: {},
|
|
};
|
|
},
|
|
methods: {
|
|
init(val, statisticType) {
|
|
this.visible = true;
|
|
this.$nextTick(() => {
|
|
this.$refs['dataForm'].resetFields();
|
|
this.dataForm = JSON.parse(JSON.stringify(val));
|
|
this.dataForm.statisticType = statisticType;
|
|
this.dataForm.ratio =
|
|
this.dataForm.ratio >= 0 ? this.dataForm.ratio * 100 : '';
|
|
});
|
|
},
|
|
// 表单提交
|
|
dataFormSubmit() {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
if (!valid) {
|
|
return false;
|
|
}
|
|
const udata = {
|
|
id: this.dataForm.id,
|
|
statisticType: this.dataForm.statisticType,
|
|
modifyThick: this.dataForm.thick,
|
|
modifySpeed: this.dataForm.speed,
|
|
modifyWidth: this.dataForm.width,
|
|
modifyInArea: this.dataForm.inArea,
|
|
modifyOutArea: this.dataForm.outArea,
|
|
modifyRatio:
|
|
this.dataForm.ratio >= 0 ? this.dataForm.ratio / 100 : '',
|
|
};
|
|
// 修改的提交
|
|
this.urlOptions.updateURL(udata).then((response) => {
|
|
this.$modal.msgSuccess('修改成功');
|
|
this.visible = false;
|
|
this.$emit('refreshDataList');
|
|
});
|
|
});
|
|
},
|
|
},
|
|
};
|
|
</script>
|