|
|
@@ -249,6 +249,7 @@
|
|
|
style="width: 100%"
|
|
|
v-model="form.charge"
|
|
|
placeholder="请选择"
|
|
|
+ :disabled="type == 'view'"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in chargeList"
|
|
|
@@ -273,6 +274,7 @@
|
|
|
style="width: 100%"
|
|
|
v-model="form.part"
|
|
|
placeholder="请选择"
|
|
|
+ :disabled="type == 'view'"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in partList"
|
|
|
@@ -297,6 +299,7 @@
|
|
|
style="width: 100%"
|
|
|
v-model="form.car"
|
|
|
placeholder="请选择是否派车"
|
|
|
+ :disabled="type == 'view'"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in carList"
|
|
|
@@ -321,8 +324,8 @@
|
|
|
style="width: 100%"
|
|
|
v-model="form.pietype"
|
|
|
placeholder="请选择"
|
|
|
- :disabled="type == 'view'"
|
|
|
@change="selectpietype"
|
|
|
+ :disabled="type == 'view'"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in pietypeList"
|
|
|
@@ -335,13 +338,6 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <!-- <spareInfo
|
|
|
- ref="spareInfoRef"
|
|
|
- :types="type"
|
|
|
- v-if="form.part == 1"
|
|
|
- title="配件信息"
|
|
|
- :detailList="detailList"
|
|
|
- /> -->
|
|
|
<spareParts
|
|
|
ref="sparePartsRef"
|
|
|
:type="type"
|
|
|
@@ -870,12 +866,12 @@ 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 spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
|
|
|
import { getToken } from '@/utils/token-util';
|
|
|
-
|
|
|
import processSubmitDialog from '@/views/salesServiceManagement/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
+// 新增:导入字典接口(用于获取售后/派车类型)
|
|
|
+import { getByCode } from '@/api/system/dictionary-data';
|
|
|
+
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
components: {
|
|
|
@@ -885,7 +881,6 @@ export default {
|
|
|
SaleorderDialog,
|
|
|
fileMain,
|
|
|
ProductDialog,
|
|
|
- // spareInfo,
|
|
|
processSubmitDialog,
|
|
|
spareParts
|
|
|
},
|
|
|
@@ -1206,38 +1201,19 @@ export default {
|
|
|
demandList: {
|
|
|
type: Array,
|
|
|
default: () => []
|
|
|
- },
|
|
|
- aftertypeList: {
|
|
|
- type: Array,
|
|
|
- default: () => []
|
|
|
- },
|
|
|
- pietypeList: {
|
|
|
- type: Array,
|
|
|
- default: () => []
|
|
|
}
|
|
|
+ // 删除:不再接收父组件传递的 aftertypeList 和 pietypeList
|
|
|
},
|
|
|
watch: {
|
|
|
+ // 保留:仅监听需求名称列表(父组件仍传递)
|
|
|
demandList: {
|
|
|
handler(val) {
|
|
|
this.demandList = val;
|
|
|
},
|
|
|
deep: true,
|
|
|
immediate: true
|
|
|
- },
|
|
|
- aftertypeList: {
|
|
|
- handler(val) {
|
|
|
- this.aftertypeList = val;
|
|
|
- },
|
|
|
- deep: true,
|
|
|
- immediate: true
|
|
|
- },
|
|
|
- pietypeList: {
|
|
|
- handler(val) {
|
|
|
- this.pietypeList = val;
|
|
|
- },
|
|
|
- deep: true,
|
|
|
- immediate: true
|
|
|
}
|
|
|
+ // 删除:删除对 aftertypeList 和 pietypeList 的监听(已自行维护)
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -1293,26 +1269,60 @@ export default {
|
|
|
carByTemplate: {},
|
|
|
processSubmitDialogFlag: false,
|
|
|
formSchema: {},
|
|
|
- carFormData: {}
|
|
|
+ carFormData: {},
|
|
|
+ // 新增:自行维护售后类型和派车类型列表
|
|
|
+ aftertypeList: [],
|
|
|
+ pietypeList: []
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ // 新增:页面创建时主动获取售后类型和派车类型
|
|
|
+ this.getAftertypeCode('after_sales_type');
|
|
|
+ this.getPietypeCode('pie_car_type');
|
|
|
+ },
|
|
|
methods: {
|
|
|
- // getSpareInfoData() {
|
|
|
- // if (this.$refs.spareInfoRef) {
|
|
|
- // return this.$refs.spareInfoRef.getSpareData() || [];
|
|
|
- // }
|
|
|
- // return [];
|
|
|
- // },
|
|
|
+ // 新增:获取售后类型字典(原父组件的 getaftertypeCode 逻辑)
|
|
|
+ async getAftertypeCode(code) {
|
|
|
+ try {
|
|
|
+ const res = await getByCode(code);
|
|
|
+ if (res.code == 0) {
|
|
|
+ let list = Object.values(res.data).map((el) => {
|
|
|
+ let k = Object.keys(el)[0];
|
|
|
+ let v = Object.values(el)[0];
|
|
|
+ return { label: v, value: k };
|
|
|
+ });
|
|
|
+ this.aftertypeList = list;
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ this.$message.error(err.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增:获取派车类型字典(原父组件的 getpietypeCode 逻辑)
|
|
|
+ async getPietypeCode(code) {
|
|
|
+ try {
|
|
|
+ const res = await getByCode(code);
|
|
|
+ if (res.code == 0) {
|
|
|
+ let list = Object.values(res.data).map((el) => {
|
|
|
+ let k = Object.keys(el)[0];
|
|
|
+ let v = Object.values(el)[0];
|
|
|
+ return { label: v, value: k };
|
|
|
+ });
|
|
|
+ this.pietypeList = list;
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ this.$message.error(err.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取配件信息
|
|
|
getSpareInfoData() {
|
|
|
if (this.$refs.sparePartsRef) {
|
|
|
- // 调用spareParts的getTableValue获取配件列表数据
|
|
|
return this.$refs.sparePartsRef.getTableValue() || [];
|
|
|
}
|
|
|
return [];
|
|
|
},
|
|
|
+ // 初始化数据
|
|
|
async init(res) {
|
|
|
- // 原有字段初始化
|
|
|
let productDetail = res.productDetail ? res.productDetail : [];
|
|
|
this.$set(this.form, 'tableList', productDetail);
|
|
|
this.$set(this.form, 'orderCode', res.orderCode);
|
|
|
@@ -1357,25 +1367,31 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 获取表单值
|
|
|
getValue() {
|
|
|
return this.form;
|
|
|
},
|
|
|
+ // 查看图片
|
|
|
seeImage(row) {
|
|
|
this.phoneList = row.imageUrl || [];
|
|
|
this.phoneVisible = true;
|
|
|
},
|
|
|
+ // 关闭图片预览
|
|
|
closePhone() {
|
|
|
this.phoneList = [];
|
|
|
this.phoneVisible = false;
|
|
|
},
|
|
|
+ // 选择客户
|
|
|
handHead() {
|
|
|
if (this.type != 'view') {
|
|
|
this.$refs.parentRef.open();
|
|
|
}
|
|
|
},
|
|
|
+ // 客户选择回调
|
|
|
changeParent(res) {
|
|
|
this.contactDetail(res.id);
|
|
|
},
|
|
|
+ // 获取客户详情
|
|
|
async contactDetail(id, type) {
|
|
|
if (!id) {
|
|
|
this.contractInfo = {};
|
|
|
@@ -1410,6 +1426,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 发货单选择回调
|
|
|
invoiceChange(data) {
|
|
|
this.$set(this.form, 'orderCode', data.orderCode);
|
|
|
this.$set(this.form, 'orderId', data.orderId);
|
|
|
@@ -1420,6 +1437,7 @@ export default {
|
|
|
);
|
|
|
this.$set(this.form, 'tableList', list);
|
|
|
},
|
|
|
+ // 打开发货单选择弹窗
|
|
|
invoiceDialogOpen() {
|
|
|
if (!this.form?.contractInfo?.id) {
|
|
|
this.$message.warning('请先选择客户名称!');
|
|
|
@@ -1435,9 +1453,11 @@ export default {
|
|
|
this.$refs.invoiceDialogRef.open(this.form.contractInfo.id, obj);
|
|
|
}
|
|
|
},
|
|
|
+ // 数量输入处理
|
|
|
totalCountChange(data, name) {
|
|
|
data[name] = data[name].replace(/[^\d]/g, '').replace(/^0+/, '') || '1';
|
|
|
},
|
|
|
+ // 添加联系人
|
|
|
addBank() {
|
|
|
this.form.contactInfoVOS.push({
|
|
|
contactName: '',
|
|
|
@@ -1445,6 +1465,7 @@ export default {
|
|
|
remark: ''
|
|
|
});
|
|
|
},
|
|
|
+ // 添加故障
|
|
|
addProblem(row) {
|
|
|
if (!row.faultDetails) this.$set(row, 'faultDetails', []);
|
|
|
let len = row.faultDetails.length;
|
|
|
@@ -1454,13 +1475,16 @@ export default {
|
|
|
faultPhenomenon: ''
|
|
|
});
|
|
|
},
|
|
|
+ // 删除子故障
|
|
|
delSon(row, idx) {
|
|
|
row.faultDetails.splice(idx, 1);
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
+ // 联系人选择回调
|
|
|
handleSelectionChange(rows) {
|
|
|
this.selection = rows;
|
|
|
},
|
|
|
+ // 批量删除联系人
|
|
|
delContact() {
|
|
|
if (this.selection.length == 0) {
|
|
|
this.$message.warning('请至少选择一条联系人信息');
|
|
|
@@ -1470,12 +1494,15 @@ export default {
|
|
|
(row) => !this.selection.includes(row)
|
|
|
);
|
|
|
},
|
|
|
+ // 删除单个联系人
|
|
|
handleBankDel(row, index) {
|
|
|
this.form.contactInfoVOS.splice(index, 1);
|
|
|
},
|
|
|
+ // 删除售后对象
|
|
|
del(row, index) {
|
|
|
this.form.tableList.splice(index, 1);
|
|
|
},
|
|
|
+ // 表单验证
|
|
|
getValidate() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.$refs.form.validate((valid, obj) => {
|
|
|
@@ -1493,6 +1520,7 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ // 重置表单
|
|
|
catch() {
|
|
|
this.form = {
|
|
|
tableList: [],
|
|
|
@@ -1510,6 +1538,7 @@ export default {
|
|
|
};
|
|
|
this.$refs.form.resetFields();
|
|
|
},
|
|
|
+ // 打开销售订单选择弹窗
|
|
|
saleorderDialogOpen() {
|
|
|
if (!this.form?.contractInfo?.id) {
|
|
|
this.$message.warning('请先选择客户名称!');
|
|
|
@@ -1525,6 +1554,7 @@ export default {
|
|
|
this.$refs.saleorderDialogRef.open(this.form.contractInfo.id, obj);
|
|
|
}
|
|
|
},
|
|
|
+ // 销售订单选择回调
|
|
|
saleorderChange(data) {
|
|
|
this.$set(this.form, 'orderCode', data.orderCode);
|
|
|
this.$set(this.form, 'orderId', data.orderId);
|
|
|
@@ -1540,9 +1570,11 @@ export default {
|
|
|
this.$set(this.form, 'faultDetailList', []);
|
|
|
}
|
|
|
},
|
|
|
+ // 打开产品选择弹窗
|
|
|
customersDialogOpen() {
|
|
|
this.$refs.productDialogRef.open();
|
|
|
},
|
|
|
+ // 产品选择回调
|
|
|
productChange(data) {
|
|
|
this.$set(this.form, 'faultDetailList', []);
|
|
|
this.$set(this.form, 'orderCode', data.orderCode);
|
|
|
@@ -1554,6 +1586,7 @@ export default {
|
|
|
);
|
|
|
this.$set(this.form, 'tableList', list);
|
|
|
},
|
|
|
+ // 添加故障(独立故障列表)
|
|
|
addFaults() {
|
|
|
this.form.faultDetailList.push({
|
|
|
maintenanceProcess: '',
|
|
|
@@ -1561,9 +1594,11 @@ export default {
|
|
|
faultPhenomenon: ''
|
|
|
});
|
|
|
},
|
|
|
+ // 删除故障
|
|
|
faultDel(index) {
|
|
|
this.form.faultDetailList.splice(index, 1);
|
|
|
},
|
|
|
+ // 关联类型选择回调
|
|
|
selectType(e) {
|
|
|
this.$set(this.form, 'tableList', []);
|
|
|
this.$set(this.form, 'faultDetailList', []);
|
|
|
@@ -1573,6 +1608,7 @@ export default {
|
|
|
this.isOrder = false;
|
|
|
}
|
|
|
},
|
|
|
+ // 派车类型选择回调
|
|
|
async selectpietype(e) {
|
|
|
if (e == '1' || e == '2') {
|
|
|
this.defaultTemplateList = await getBpmCustomFormList({ status: 1 });
|
|
|
@@ -1593,6 +1629,7 @@ export default {
|
|
|
this.processSubmitDialogFlag = true;
|
|
|
}
|
|
|
},
|
|
|
+ // 流程表单提交回调
|
|
|
handleFormSubmit(data) {
|
|
|
this.carFormData = data;
|
|
|
}
|