225 lines
5.8 KiB
Plaintext
225 lines
5.8 KiB
Plaintext
<template>
|
|
<!-- 短装数量 -->
|
|
<el-container style="margin-top: 10px;" v-loading="loading">
|
|
<!-- 添加或修改参数配置对话框 -->
|
|
<el-form
|
|
ref="form"
|
|
:model="form"
|
|
label-width="110px"
|
|
:rules="rules"
|
|
align="left"
|
|
style="width: 100%;"
|
|
>
|
|
<!-- 第一行 -->
|
|
<el-row>
|
|
<el-col :span="8">
|
|
<el-form-item label="检验单号" prop="inspectBillNumber">
|
|
<el-input
|
|
v-model="form.inspectBillNumber"
|
|
style="width: 95%"
|
|
placeholder=""
|
|
size="small"
|
|
disabled
|
|
/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item label="到货单号" prop="arriveBillNumber">
|
|
<el-input
|
|
v-model="form.arriveBillNumber"
|
|
style="width: 95%"
|
|
placeholder=""
|
|
size="small"
|
|
disabled
|
|
/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item label="物料条码" prop="materialBar">
|
|
<el-input
|
|
v-model="form.materialBar"
|
|
style="width: 95%"
|
|
placeholder=""
|
|
size="small"
|
|
disabled
|
|
/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item label="物料编码" prop="materialCode">
|
|
<el-input
|
|
v-model="form.materialCode"
|
|
style="width: 95%"
|
|
placeholder=""
|
|
size="small"
|
|
disabled
|
|
/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<!-- <el-col :span="8">-->
|
|
<!-- <el-form-item label="检验数量" prop="materialQty">-->
|
|
<!-- <el-input-->
|
|
<!-- v-model="form.materialQty"-->
|
|
<!-- style="width: 95%"-->
|
|
<!-- placeholder=""-->
|
|
<!-- size="small"-->
|
|
<!-- disabled-->
|
|
<!-- />-->
|
|
<!-- </el-form-item>-->
|
|
<!-- </el-col>-->
|
|
<el-col :span="8">
|
|
<el-form-item label="短装数量" prop="shortDress">
|
|
<el-input
|
|
v-model="form.shortDress"
|
|
style="width: 95%"
|
|
placeholder=""
|
|
size="small"
|
|
/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
<!-- 表单按钮 -->
|
|
<el-row style="margin-top:20px">
|
|
<el-col :span="24">
|
|
<el-form-item style="float: right;margin-right: 20px">
|
|
<el-button
|
|
type="primary"
|
|
@click="submitForm"
|
|
v-loading="saveLoading"
|
|
>确 定</el-button
|
|
>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</el-container>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
layerid: {
|
|
type: String,
|
|
default: ""
|
|
},
|
|
row: {
|
|
type: Object,
|
|
default: undefined
|
|
},
|
|
formType: {
|
|
type: Number,
|
|
default: 0
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
loading: false,
|
|
form: {
|
|
id: "",
|
|
inspectBillNumber:"",
|
|
arriveBillNumber:"",
|
|
materialBar: "",
|
|
materialCode: "",
|
|
materialQty: "",
|
|
spotCheckQty: "",
|
|
spotCheckQualifiedQty: "",
|
|
spotCheckUnqualifiedQty: ""
|
|
},
|
|
rules: {},
|
|
saveLoading: false
|
|
};
|
|
},
|
|
created() {
|
|
console.log(this.row);
|
|
this.form = {
|
|
id: this.row.id,
|
|
arriveBillNumber:this.row.arriveBillNumber,
|
|
inspectBillNumber:this.row.inspectBillNumber,
|
|
materialBar: this.row.materialBar,
|
|
materialCode: this.row.materialCode,
|
|
materialQty: this.row.materialQty,
|
|
spotCheckQty: this.row.spotCheckQty,
|
|
spotCheckQualifiedQty: this.row.spotCheckQualifiedQty,
|
|
spotCheckUnqualifiedQty: this.row.spotCheckUnqualifiedQty
|
|
};
|
|
},
|
|
methods: {
|
|
//保存按钮
|
|
submitForm() {
|
|
// this.changeSpotCheckQty();
|
|
var dto = {
|
|
id: this.form.id,
|
|
materialQty: this.form.shortDress
|
|
};
|
|
if (this.saveLoading) return;
|
|
this.saveLoading = true;
|
|
this.$inspectBill
|
|
.arriveLess(dto)
|
|
.then(res => {
|
|
if (res.data.code == 200) {
|
|
this.$message.success("修改成功");
|
|
this.$layer.close(this.layerid);
|
|
this.$parent.initData();
|
|
this.$parent.$parent.getList();
|
|
} else {
|
|
this.$message.error(res.data.msg);
|
|
}
|
|
this.saveLoading = false;
|
|
})
|
|
},
|
|
//取消按钮
|
|
cancel() {
|
|
this.reset();
|
|
this.$layer.close(this.layerid);
|
|
},
|
|
//重置表单
|
|
reset() {
|
|
this.form = {
|
|
id: "",
|
|
inspectBillNumber:"",
|
|
arriveBillNumber:"",
|
|
materialBar: "",
|
|
materialCode: "",
|
|
materialQty: "",
|
|
spotCheckQty: "",
|
|
spotCheckQualifiedQty: "",
|
|
spotCheckUnqualifiedQty: ""
|
|
};
|
|
},
|
|
changeSpotCheckQty() {
|
|
if (this.form.materialQty < this.form.spotCheckQty) {
|
|
this.form.spotCheckQty = this.form.materialQty;
|
|
}
|
|
if (this.form.spotCheckUnqualifiedQty > this.form.spotCheckQty) {
|
|
this.form.spotCheckUnqualifiedQty = 0;
|
|
}
|
|
this.form.spotCheckQualifiedQty =
|
|
this.form.spotCheckQty - this.form.spotCheckUnqualifiedQty;
|
|
},
|
|
changeSpotCheckUnqualifiedQty() {
|
|
this.form.spotCheckQualifiedQty =
|
|
this.form.spotCheckQty - this.form.spotCheckUnqualifiedQty;
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.el-form-item {
|
|
margin-bottom: 10px;
|
|
}
|
|
>>> .el-table__body tr.current-row > td {
|
|
background-color: #8ac1ff !important;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.el-table >>> tbody tr:hover > td {
|
|
background-color: #8ac1ff !important;
|
|
}
|
|
.input_inner /deep/ .el-input__inner {
|
|
background-color: white !important;
|
|
}
|
|
</style>
|