|
@@ -72,9 +72,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="物流/快递单" prop="code">
|
|
|
+ <el-form-item label="物流/快递单" prop="waybill">
|
|
|
<el-input
|
|
|
- v-model="form.code"
|
|
|
+ v-model="form.waybill"
|
|
|
placeholder="物流/快递单号"
|
|
|
:disabled="showType === 'details'"
|
|
|
></el-input>
|
|
@@ -91,28 +91,23 @@
|
|
|
>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-table
|
|
|
- :data="form.logisticsDetailsList"
|
|
|
- v-if="showType !== 'details'"
|
|
|
- >
|
|
|
+ <el-table :data="form.list" v-if="showType !== 'details'">
|
|
|
<el-table-column label="产品类型" prop="classifyName">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="产品编码" prop="productCode">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="产品名称" prop="productName">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="退货数量" prop="shipmentQuantity">
|
|
|
+ <el-table-column label="退货数量" prop="quantity">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- :prop="
|
|
|
- 'logisticsDetailsList.' + scope.$index + '.shipmentQuantity'
|
|
|
- "
|
|
|
- :rules="formRules.shipmentQuantity"
|
|
|
+ :prop="'list.' + scope.$index + '.quantity'"
|
|
|
+ :rules="formRules.quantity"
|
|
|
:inline-message="true"
|
|
|
label-width="0"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="scope.row.shipmentQuantity"
|
|
|
+ v-model="scope.row.quantity"
|
|
|
placeholder="请输入"
|
|
|
size="mini"
|
|
|
:disabled="showType === 'details'"
|
|
@@ -130,10 +125,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <el-table
|
|
|
- :data="form.logisticsDetailsList"
|
|
|
- v-if="showType === 'details'"
|
|
|
- >
|
|
|
+ <el-table :data="form.list" v-if="showType === 'details'">
|
|
|
<el-table-column label="退货单号" prop="backCode" />
|
|
|
<el-table-column label="申请时间" prop="applicationTime" />
|
|
|
<el-table-column label="备件条码" prop="spareParts" />
|
|
@@ -228,7 +220,14 @@ export default {
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- shipmentQuantity: [
|
|
|
+ waybill: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请输入物流/快递单号",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ quantity: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入退货数量",
|
|
@@ -282,17 +281,14 @@ export default {
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.showType !== "details") {
|
|
|
- if (this.form.logisticsDetailsList.length < 1) {
|
|
|
+ if (this.form.list.length < 1) {
|
|
|
return this.msgInfo("请添加退货明细!");
|
|
|
}
|
|
|
this.loading = true;
|
|
|
- this.form.logisticsDetailsList = this.form.logisticsDetailsList.map(
|
|
|
- (x) => ({
|
|
|
- jdBackProductId: x.jdBackProductId,
|
|
|
- shipmentQuantity: x.shipmentQuantity,
|
|
|
- id: x.id,
|
|
|
- })
|
|
|
- );
|
|
|
+ this.form.list = this.form.list.map((x) => ({
|
|
|
+ id: x.jdBackProductId,
|
|
|
+ quantity: x.quantity,
|
|
|
+ }));
|
|
|
}
|
|
|
this.$emit("submit");
|
|
|
}
|
|
@@ -313,23 +309,21 @@ export default {
|
|
|
this.selectDialog = true;
|
|
|
},
|
|
|
handleSelect(row) {
|
|
|
- const flag = this.form.logisticsDetailsList.some(
|
|
|
- (x) => x.jdBackProductId === row.id
|
|
|
- );
|
|
|
+ const flag = this.form.list.some((x) => x.jdBackProductId === row.id);
|
|
|
if (flag) return this.msgInfo("该产品已经选择");
|
|
|
const product = {
|
|
|
classifyName: row.classifyName || "",
|
|
|
productCode: row.code,
|
|
|
productName: row.name,
|
|
|
jdBackProductId: row.id,
|
|
|
- shipmentQuantity: "",
|
|
|
+ quantity: "",
|
|
|
id: "",
|
|
|
};
|
|
|
- this.form.logisticsDetailsList.push(product);
|
|
|
+ this.form.list.push(product);
|
|
|
this.msgSuccess("选择成功");
|
|
|
},
|
|
|
deleteRow(index) {
|
|
|
- this.form.logisticsDetailsList.splice(index, 1);
|
|
|
+ this.form.list.splice(index, 1);
|
|
|
this.msgSuccess("删除成功");
|
|
|
},
|
|
|
},
|