|
|
@@ -335,13 +335,20 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <spareInfo
|
|
|
+ <!-- <spareInfo
|
|
|
ref="spareInfoRef"
|
|
|
:types="type"
|
|
|
v-if="form.part == 1"
|
|
|
title="配件信息"
|
|
|
:detailList="detailList"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
+ <spareParts
|
|
|
+ ref="sparePartsRef"
|
|
|
+ :type="type"
|
|
|
+ :source="source"
|
|
|
+ obtain="仓库"
|
|
|
+ v-if="form.part == 1"
|
|
|
+/>
|
|
|
<div class="after_sales_target" v-if="salesShow">
|
|
|
<headerTitle
|
|
|
title="售后对象"
|
|
|
@@ -863,7 +870,9 @@ import parentList from '@/views/saleManage/contact/components/parentList.vue';
|
|
|
import invoiceDialog from './invoiceDialog.vue';
|
|
|
import SaleorderDialog from './saleorderDialog.vue';
|
|
|
import ProductDialog from './productDialog.vue';
|
|
|
-import spareInfo from '@/views/salesServiceManagement/accessory/components/spareInfo.vue';
|
|
|
+// import spareInfo from '@/views/salesServiceManagement/accessory/components/spareInfo.vue';
|
|
|
+
|
|
|
+import spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
|
|
|
import { getToken } from '@/utils/token-util';
|
|
|
|
|
|
import processSubmitDialog from '@/views/salesServiceManagement/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
@@ -876,8 +885,9 @@ export default {
|
|
|
SaleorderDialog,
|
|
|
fileMain,
|
|
|
ProductDialog,
|
|
|
- spareInfo,
|
|
|
- processSubmitDialog
|
|
|
+ // spareInfo,
|
|
|
+ processSubmitDialog,
|
|
|
+ spareParts
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['getDictValue']),
|
|
|
@@ -1288,12 +1298,19 @@ export default {
|
|
|
},
|
|
|
created() {},
|
|
|
methods: {
|
|
|
+ // getSpareInfoData() {
|
|
|
+ // if (this.$refs.spareInfoRef) {
|
|
|
+ // return this.$refs.spareInfoRef.getSpareData() || [];
|
|
|
+ // }
|
|
|
+ // return [];
|
|
|
+ // },
|
|
|
getSpareInfoData() {
|
|
|
- if (this.$refs.spareInfoRef) {
|
|
|
- return this.$refs.spareInfoRef.getSpareData() || [];
|
|
|
- }
|
|
|
- return [];
|
|
|
- },
|
|
|
+ if (this.$refs.sparePartsRef) {
|
|
|
+ // 调用spareParts的getTableValue获取配件列表数据
|
|
|
+ return this.$refs.sparePartsRef.getTableValue() || [];
|
|
|
+ }
|
|
|
+ return [];
|
|
|
+},
|
|
|
async init(res) {
|
|
|
// 原有字段初始化
|
|
|
let productDetail = res.productDetail ? res.productDetail : [];
|
|
|
@@ -1319,15 +1336,26 @@ export default {
|
|
|
this.isOrder = true;
|
|
|
}
|
|
|
|
|
|
- // 核心修复:回显字段赋值
|
|
|
- this.$set(this.form, 'aftertype', res.afterSalesType ?? '');
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ 'aftertype',
|
|
|
+ res.afterSalesType ? String(res.afterSalesType) : ''
|
|
|
+ );
|
|
|
this.$set(this.form, 'charge', res.isFee ?? '');
|
|
|
this.$set(this.form, 'part', res.isWithAccessories ?? '');
|
|
|
this.$set(this.form, 'car', res.isPieCar ?? '');
|
|
|
- this.$set(this.form, 'pietype', res.pieCarType ?? '');
|
|
|
-
|
|
|
- // 配件数据回显:从后端res.costListVOS获取并赋值给detailList
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ 'pietype',
|
|
|
+ res.pieCarType ? String(res.pieCarType) : ''
|
|
|
+ );
|
|
|
+
|
|
|
this.$set(this, 'detailList', res.costListVOS || []);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.sparePartsRef && this.detailList.length > 0) {
|
|
|
+ this.$refs.sparePartsRef.setTableValue(this.detailList);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
getValue() {
|
|
|
return this.form;
|