|
@@ -10,25 +10,25 @@
|
|
|
>
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="4">
|
|
|
- <el-form-item label="采购单号" prop="code">
|
|
|
- <el-input v-model="form.code" disabled></el-input>
|
|
|
+ <el-form-item label="采购单号" prop="purchaseCode">
|
|
|
+ <el-input v-model="form.purchaseCode" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item label="供应商" prop="supplyName">
|
|
|
- <el-input v-model="form.supplyName" disabled></el-input>
|
|
|
+ <el-form-item label="供应商" prop="supplierName">
|
|
|
+ <el-input v-model="form.supplierName" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="4">
|
|
|
- <el-form-item label="物流公司" prop="code">
|
|
|
- <el-input v-model="form.code" disabled></el-input>
|
|
|
+ <el-form-item label="物流公司" prop="logisticsCompanyName">
|
|
|
+ <el-input v-model="form.logisticsCompanyName" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="物流/快递单号" prop="supplyName">
|
|
|
- <el-input v-model="form.supplyName" disabled></el-input>
|
|
|
+ <el-form-item label="物流/快递单号" prop="code">
|
|
|
+ <el-input v-model="form.code" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -42,18 +42,21 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="物品名称" prop="productName">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="待质检数量" prop="name"> </el-table-column>
|
|
|
+ <el-table-column label="待质检数量" prop="totalQuantity">
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <el-table-column label="质检合格" prop="quantity">
|
|
|
+ <el-table-column label="质检合格" prop="qualifiedQuantity">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- :prop="'changeProductList.' + scope.$index + '.quantity'"
|
|
|
- :rules="formRules.quantity"
|
|
|
+ :prop="
|
|
|
+ 'changeProductList.' + scope.$index + '.qualifiedQuantity'
|
|
|
+ "
|
|
|
+ :rules="formRules.qualifiedQuantity"
|
|
|
:inline-message="true"
|
|
|
label-width="0"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="scope.row.quantity"
|
|
|
+ v-model="scope.row.qualifiedQuantity"
|
|
|
placeholder="请输入"
|
|
|
size="mini"
|
|
|
>
|
|
@@ -61,16 +64,20 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="质检不合格" prop="quantity">
|
|
|
+ <el-table-column label="质检不合格" prop="disqualificationQuantity">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- :prop="'changeProductList.' + scope.$index + '.quantity'"
|
|
|
- :rules="formRules.quantity"
|
|
|
+ :prop="
|
|
|
+ 'changeProductList.' +
|
|
|
+ scope.$index +
|
|
|
+ '.disqualificationQuantity'
|
|
|
+ "
|
|
|
+ :rules="formRules.disqualificationQuantity"
|
|
|
:inline-message="true"
|
|
|
label-width="0"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="scope.row.quantity"
|
|
|
+ v-model="scope.row.disqualificationQuantity"
|
|
|
placeholder="请输入"
|
|
|
size="mini"
|
|
|
>
|
|
@@ -78,16 +85,6 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <!-- <el-table-column
|
|
|
- label="操作"
|
|
|
- width="100"
|
|
|
- align="left"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="deleteRow(scope.$index)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -98,27 +95,17 @@
|
|
|
确定</el-button
|
|
|
>
|
|
|
</div>
|
|
|
- <!-- <el-dialog
|
|
|
- title="物品选择"
|
|
|
- v-if="selectDialog"
|
|
|
- :visible.sync="selectDialog"
|
|
|
- width="80%"
|
|
|
- top="60px"
|
|
|
- >
|
|
|
- <selectProduct @select="handleSelect"></selectProduct>
|
|
|
- </el-dialog> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import labelTitle from "@/components/label-title/index.vue";
|
|
|
-import selectProduct from "@/components/select-product/index.vue";
|
|
|
|
|
|
import { getToken } from "@/util/auth";
|
|
|
|
|
|
export default {
|
|
|
- name: "addManualOutbound",
|
|
|
- components: { labelTitle, selectProduct },
|
|
|
+ name: "addInspection",
|
|
|
+ components: { labelTitle },
|
|
|
props: {
|
|
|
form: {
|
|
|
type: Object,
|
|
@@ -138,25 +125,18 @@ export default {
|
|
|
loading: false,
|
|
|
selectDialog: false,
|
|
|
formRules: {
|
|
|
- quantity: [
|
|
|
+ qualifiedQuantity: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入质检合格数量",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- outWarehouseId: [
|
|
|
+ disqualificationQuantity: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请选择调出仓库",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- inWarehouseId: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择调入仓库",
|
|
|
- trigger: "change",
|
|
|
+ message: "请输入质检不合格数量",
|
|
|
+ trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
},
|
|
@@ -167,8 +147,17 @@ export default {
|
|
|
handleSubmit() {
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if (!this.form.changeProductList.length > 0)
|
|
|
- return this.msgInfo("请添加调仓明细");
|
|
|
+ for (let i = 0; i < this.form.changeProductList.length; i++) {
|
|
|
+ if (
|
|
|
+ Number(this.form.changeProductList[i].qualifiedQuantity) +
|
|
|
+ Number(
|
|
|
+ this.form.changeProductList[i].disqualificationQuantity
|
|
|
+ ) >
|
|
|
+ Number(this.form.changeProductList[i].totalQuantity)
|
|
|
+ ) {
|
|
|
+ return this.msgInfo("质检合格和质检不合格总合不能大于待质检数量");
|
|
|
+ }
|
|
|
+ }
|
|
|
this.loading = true;
|
|
|
this.$emit("submit");
|
|
|
}
|
|
@@ -177,30 +166,6 @@ export default {
|
|
|
handleCancel() {
|
|
|
this.$emit("cancel");
|
|
|
},
|
|
|
- handleAddProduct() {
|
|
|
- if (this.form.outWarehouseId === this.form.inWarehouseId)
|
|
|
- return this.msgInfo("调出和调入仓库不可一致");
|
|
|
- if (!(this.form.outWarehouseId && this.form.inWarehouseId))
|
|
|
- return this.msgInfo("请先选择要调的仓库");
|
|
|
- this.selectDialog = true;
|
|
|
- },
|
|
|
- handleSelect(row) {
|
|
|
- const flag = this.form.changeProductList.some(
|
|
|
- (x) => x.productId === row.id
|
|
|
- );
|
|
|
- if (flag) return this.msgInfo("该物品已经选择");
|
|
|
- const product = {
|
|
|
- productCode: row.code,
|
|
|
- productName: row.name,
|
|
|
- productId: row.id,
|
|
|
- quantity: "",
|
|
|
- };
|
|
|
- this.form.changeProductList.push(product);
|
|
|
- },
|
|
|
- deleteRow(index) {
|
|
|
- this.form.changeProductList.splice(index, 1);
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|