|
@@ -168,6 +168,8 @@
|
|
|
<Select
|
|
|
placeholder="请选择负责人"
|
|
|
v-if="type != 3"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
v-model="info.custom_detail_name"
|
|
|
@on-change="handleClientChargeChange"
|
|
|
class="auto-width"
|
|
@@ -310,7 +312,9 @@
|
|
|
v-if="
|
|
|
formSetTableData.filter((v) => v.key == 'order_price')[0].is_show
|
|
|
"
|
|
|
- :label="formSetTableData.filter((v) => v.key == 'order_price')[0].title"
|
|
|
+ :label="
|
|
|
+ formSetTableData.filter((v) => v.key == 'order_price')[0].title
|
|
|
+ "
|
|
|
>
|
|
|
<Input
|
|
|
v-model="info.order_price"
|
|
@@ -813,6 +817,7 @@
|
|
|
<Input
|
|
|
size="small"
|
|
|
v-model="item.num"
|
|
|
+ disabled
|
|
|
style="width: 120px"
|
|
|
placeholder="自动带出"
|
|
|
/>
|
|
@@ -977,7 +982,10 @@
|
|
|
:key="element.id + '111' + idx"
|
|
|
:label-width="50"
|
|
|
>
|
|
|
- <FormItem :label-width="element.isBP ? 1 : 50">
|
|
|
+ <FormItem
|
|
|
+ :label-width="element.isBP ? 1 : 50"
|
|
|
+ v-show="!element.is_metal"
|
|
|
+ >
|
|
|
<Radio
|
|
|
v-show="element.isBP"
|
|
|
@click.native.prevent="handleRadioClick(element)"
|
|
@@ -985,7 +993,7 @@
|
|
|
></Radio>
|
|
|
<span v-show="element.isBP">{{ element.part_title }} </span>
|
|
|
</FormItem>
|
|
|
- <FormItem label="部件:">
|
|
|
+ <FormItem label="部件:" v-show="!element.is_metal">
|
|
|
<Select
|
|
|
filterable
|
|
|
clearable
|
|
@@ -1006,7 +1014,7 @@
|
|
|
></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="高:">
|
|
|
+ <FormItem label="高:" v-show="!element.is_metal">
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
@@ -1015,7 +1023,7 @@
|
|
|
placeholder="请输入厚"
|
|
|
/>
|
|
|
</FormItem>
|
|
|
- <FormItem label="宽:">
|
|
|
+ <FormItem label="宽:" v-show="!element.is_metal">
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
@@ -1024,7 +1032,7 @@
|
|
|
placeholder="请输入宽"
|
|
|
/>
|
|
|
</FormItem>
|
|
|
- <FormItem label="厚:">
|
|
|
+ <FormItem label="厚:" v-show="!element.is_metal">
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
@@ -1037,6 +1045,7 @@
|
|
|
v-for="(process_detail, idx) in element.process"
|
|
|
:key="process_detail.name + '222' + element.part_id"
|
|
|
:label="process_detail.name + ':'"
|
|
|
+ v-show="!element.is_metal"
|
|
|
>
|
|
|
<Tooltip style="width: 120px" transfer>
|
|
|
<span slot="content">
|
|
@@ -1067,7 +1076,7 @@
|
|
|
</Select>
|
|
|
</Tooltip>
|
|
|
</FormItem>
|
|
|
- <FormItem>
|
|
|
+ <FormItem v-show="!element.is_metal">
|
|
|
<Button
|
|
|
@click="handlePartsApart(element, idx, item.part)"
|
|
|
type="primary"
|
|
@@ -1312,7 +1321,9 @@
|
|
|
<FormItem>
|
|
|
<a
|
|
|
style="color: red"
|
|
|
- @click="handleExtraDele(item.metalArray, element, idx)"
|
|
|
+ @click="
|
|
|
+ handleExtraDele(item.metalArray, element, idx, item)
|
|
|
+ "
|
|
|
>删除</a
|
|
|
>
|
|
|
</FormItem>
|
|
@@ -1379,7 +1390,9 @@
|
|
|
<FormItem>
|
|
|
<a
|
|
|
style="color: red"
|
|
|
- @click="handleExtraDele(item.extArray, element, idx)"
|
|
|
+ @click="
|
|
|
+ handleExtraDele(item.extArray, element, idx, item)
|
|
|
+ "
|
|
|
>删除</a
|
|
|
>
|
|
|
</FormItem>
|
|
@@ -1552,7 +1565,7 @@
|
|
|
<Input
|
|
|
size="small"
|
|
|
v-model="modalData.num"
|
|
|
- :disabled="isCheck"
|
|
|
+ disabled
|
|
|
style="width: 120px"
|
|
|
placeholder="自动带出"
|
|
|
/>
|
|
@@ -1731,7 +1744,10 @@
|
|
|
:key="element.id + '444' + idx"
|
|
|
:label-width="50"
|
|
|
>
|
|
|
- <FormItem :label-width="element.isBP ? 1 : 50">
|
|
|
+ <FormItem
|
|
|
+ :label-width="element.isBP ? 1 : 50"
|
|
|
+ v-show="!element.is_metal"
|
|
|
+ >
|
|
|
<Radio
|
|
|
v-show="element.isBP"
|
|
|
:disabled="isCheck"
|
|
@@ -1740,7 +1756,10 @@
|
|
|
></Radio>
|
|
|
<span v-show="element.isBP">{{ element.part_title }} </span>
|
|
|
</FormItem>
|
|
|
- <FormItem label="部件:">
|
|
|
+ <FormItem
|
|
|
+ label="部件:"
|
|
|
+ v-show="element.is_metal ? false : true"
|
|
|
+ >
|
|
|
<Select
|
|
|
filterable
|
|
|
clearable
|
|
@@ -1766,7 +1785,7 @@
|
|
|
></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="高:">
|
|
|
+ <FormItem label="高:" v-show="!element.is_metal">
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
@@ -1776,7 +1795,7 @@
|
|
|
placeholder="请输入厚"
|
|
|
/>
|
|
|
</FormItem>
|
|
|
- <FormItem label="宽:">
|
|
|
+ <FormItem label="宽:" v-show="!element.is_metal">
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
@@ -1786,7 +1805,7 @@
|
|
|
placeholder="请输入宽"
|
|
|
/>
|
|
|
</FormItem>
|
|
|
- <FormItem label="厚:">
|
|
|
+ <FormItem label="厚:" v-show="!element.is_metal">
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
@@ -1800,6 +1819,7 @@
|
|
|
v-for="(process_detail, idx) in element.process"
|
|
|
:key="idx + '555' + element.part_id"
|
|
|
:label="process_detail.name + ':'"
|
|
|
+ v-show="!element.is_metal"
|
|
|
>
|
|
|
<Tooltip style="width: 120px" transfer>
|
|
|
<span slot="content">
|
|
@@ -1831,7 +1851,7 @@
|
|
|
</Select>
|
|
|
</Tooltip>
|
|
|
</FormItem>
|
|
|
- <FormItem>
|
|
|
+ <FormItem v-show="!element.is_metal">
|
|
|
<Button
|
|
|
@click="handlePartsApart(element, idx, modalData.part)"
|
|
|
type="primary"
|
|
@@ -2098,8 +2118,14 @@
|
|
|
<FormItem>
|
|
|
<a
|
|
|
style="color: red"
|
|
|
+ v-show="!isCheck"
|
|
|
@click="
|
|
|
- handleExtraDele(modalData.metalArray, element, idx)
|
|
|
+ handleExtraDele(
|
|
|
+ modalData.metalArray,
|
|
|
+ element,
|
|
|
+ idx,
|
|
|
+ modalData
|
|
|
+ )
|
|
|
"
|
|
|
>删除</a
|
|
|
>
|
|
@@ -2171,8 +2197,16 @@
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
<a
|
|
|
+ v-show="!isCheck"
|
|
|
style="color: red"
|
|
|
- @click="handleExtraDele(modalData.extArray, element, idx)"
|
|
|
+ @click="
|
|
|
+ handleExtraDele(
|
|
|
+ modalData.extArray,
|
|
|
+ element,
|
|
|
+ idx,
|
|
|
+ modalData
|
|
|
+ )
|
|
|
+ "
|
|
|
>删除</a
|
|
|
>
|
|
|
</FormItem>
|
|
@@ -2443,10 +2477,6 @@ export default {
|
|
|
"on-change": (e) => {
|
|
|
currentRow.is_show = e;
|
|
|
this.post_formSetTableData.splice(index, 1, currentRow);
|
|
|
- console.log(
|
|
|
- "this.post_formSetTableData :>> ",
|
|
|
- this.post_formSetTableData
|
|
|
- );
|
|
|
},
|
|
|
},
|
|
|
});
|
|
@@ -2572,6 +2602,8 @@ export default {
|
|
|
{ is_show: true, key: "remark", value: "订单备注", title: "订单备注" },
|
|
|
],
|
|
|
post_formSetTableData: [],
|
|
|
+ charge_list: [],
|
|
|
+ cus_list: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -2582,6 +2614,16 @@ export default {
|
|
|
},
|
|
|
watch: {},
|
|
|
created() {
|
|
|
+ // 获取负责人列表
|
|
|
+ this.axios.get("/api/support_service_name").then((res) => {
|
|
|
+ this.clientDetailList_respon = [];
|
|
|
+ res.data.map((item) => {
|
|
|
+ this.clientDetailList_respon.push({ service_name: item });
|
|
|
+ });
|
|
|
+ this.charge_list = JSON.parse(
|
|
|
+ JSON.stringify(this.clientDetailList_respon)
|
|
|
+ );
|
|
|
+ });
|
|
|
// 获取设置表单
|
|
|
this.get_forms();
|
|
|
// 获取紧急程度
|
|
@@ -2591,6 +2633,7 @@ export default {
|
|
|
});
|
|
|
// 获取客户列表
|
|
|
this.axios.get("/api/custom_list").then((res) => {
|
|
|
+ this.cus_list = JSON.parse(JSON.stringify(res.data.data));
|
|
|
this.clientList = res.data.data;
|
|
|
});
|
|
|
// 获取五金列表
|
|
@@ -2649,7 +2692,11 @@ export default {
|
|
|
this.axios
|
|
|
.post("/api/update/get_table", { id: "businessorderlist_detail" })
|
|
|
.then((res) => {
|
|
|
- if (res.data.table.formSet && res.data.table.formSet.length > 0) {
|
|
|
+ if (
|
|
|
+ res.data.length > 0 &&
|
|
|
+ res.data.table.formSet &&
|
|
|
+ res.data.table.formSet.length > 0
|
|
|
+ ) {
|
|
|
this.formSetTableData = JSON.parse(
|
|
|
JSON.stringify(res.data.table.formSet)
|
|
|
);
|
|
@@ -2658,7 +2705,7 @@ export default {
|
|
|
);
|
|
|
} else {
|
|
|
this.post_formSetTableData = JSON.parse(
|
|
|
- JSON.stringify(res.data.table.formSet)
|
|
|
+ JSON.stringify(this.formSetTableData)
|
|
|
);
|
|
|
}
|
|
|
});
|
|
@@ -3056,7 +3103,7 @@ export default {
|
|
|
//其他项
|
|
|
this.modalData.other = this.modalData.customize;
|
|
|
// 部件字段
|
|
|
- this.modalData.part.forEach((elem) => {
|
|
|
+ this.modalData.part.forEach((elem, idx) => {
|
|
|
if (!elem.is_metal) {
|
|
|
elem.title ? "" : (elem.title = elem.part_title);
|
|
|
// if (elem.procedure_properties_str && elem.procedure_properties_str != 0) {
|
|
@@ -3072,6 +3119,8 @@ export default {
|
|
|
});
|
|
|
elem.process_str = elem.procedure_properties_str.join("/");
|
|
|
// }
|
|
|
+ } else {
|
|
|
+ this.modalData.part.splice(idx, 1);
|
|
|
}
|
|
|
});
|
|
|
this.modalData.metalArray.map((item) => {
|
|
@@ -3080,14 +3129,14 @@ export default {
|
|
|
title: item.title,
|
|
|
unit_price: item.price,
|
|
|
ext_price: item.num * item.price,
|
|
|
- is_metal: false,
|
|
|
+ is_metal: true,
|
|
|
};
|
|
|
this.modalData.part.push(obj);
|
|
|
});
|
|
|
this.modalData.extra = "";
|
|
|
this.modalData.extArray.map((item) => {
|
|
|
const temp = this.extList.filter((it) => it.id == item.ext_id);
|
|
|
- item.title = temp[0].title;
|
|
|
+ temp && temp.length > 0 && (item.title = temp[0].title);
|
|
|
});
|
|
|
this.modalData.extra = this.modalData.extArray.reduce((pre, cur) => {
|
|
|
return pre + `${cur.title}/`;
|
|
@@ -3282,8 +3331,9 @@ export default {
|
|
|
});
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
- handleExtraDele(array, row, index) {
|
|
|
+ handleExtraDele(array, row, index, modalData) {
|
|
|
array.splice(index, 1);
|
|
|
+ this.handleTotalPriceCalc(row, modalData);
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
getCoumstList() {
|
|
@@ -3324,7 +3374,7 @@ export default {
|
|
|
return arr;
|
|
|
},
|
|
|
handleClientChange(id) {
|
|
|
- id &&
|
|
|
+ if (id) {
|
|
|
this.axios({
|
|
|
method: "get",
|
|
|
url: "/api/custom_detail",
|
|
@@ -3356,6 +3406,12 @@ export default {
|
|
|
this.fax = res.data.detail.fax;
|
|
|
this.$forceUpdate();
|
|
|
});
|
|
|
+ } else {
|
|
|
+ this.clientDetailList_respon = JSON.parse(
|
|
|
+ JSON.stringify(this.charge_list)
|
|
|
+ );
|
|
|
+ this.clientList = JSON.parse(JSON.stringify(this.cus_list));
|
|
|
+ }
|
|
|
},
|
|
|
handleSpan({ row, column, rowIndex, columnIndex }) {
|
|
|
if (row.end) {
|
|
@@ -3402,23 +3458,68 @@ export default {
|
|
|
},
|
|
|
handleClientChargeChange(value) {
|
|
|
if (value) {
|
|
|
- this.info.custom_detail_name = value;
|
|
|
- // 取出手机号码是该负责人的
|
|
|
- this.clientDetailList_mobile = this.clientDetailList.filter(
|
|
|
- (item) => item.service_name == this.info.custom_detail_name
|
|
|
- );
|
|
|
- // 赋值默认手机号码
|
|
|
- this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
|
|
|
- // 去重手机号码
|
|
|
- this.clientDetailList_mobile = this.unique(
|
|
|
- this.clientDetailList_mobile
|
|
|
- );
|
|
|
- // 取出地址是该负责人的
|
|
|
- this.clientDetailList_address = this.clientDetailList.filter(
|
|
|
- (item) => item.service_name == this.info.custom_detail_name
|
|
|
+ // if (this.info.custom_id) {
|
|
|
+ // this.info.custom_detail_name = value;
|
|
|
+ // // 取出手机号码是该负责人的
|
|
|
+ // this.clientDetailList_mobile = this.clientDetailList.filter(
|
|
|
+ // (item) => item.service_name == this.info.custom_detail_name
|
|
|
+ // );
|
|
|
+ // // 赋值默认手机号码
|
|
|
+ // this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
|
|
|
+ // // 去重手机号码
|
|
|
+ // this.clientDetailList_mobile = this.unique(
|
|
|
+ // this.clientDetailList_mobile
|
|
|
+ // );
|
|
|
+ // // 取出地址是该负责人的
|
|
|
+ // this.clientDetailList_address = this.clientDetailList.filter(
|
|
|
+ // (item) => item.service_name == this.info.custom_detail_name
|
|
|
+ // );
|
|
|
+ // // 赋值默认地址
|
|
|
+ // this.info.custom_detail_id = this.clientDetailList_address[0].id || 0;
|
|
|
+ // } else {
|
|
|
+ this.axios
|
|
|
+ .get("/api/support_custom_for_service", {
|
|
|
+ params: { name: this.info.custom_detail_name },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.clientList = res.data.data;
|
|
|
+ this.info.custom_id = res.data.data[0].id;
|
|
|
+ this.axios({
|
|
|
+ method: "get",
|
|
|
+ url: "/api/custom_detail",
|
|
|
+ params: { id: res.data.data[0].id },
|
|
|
+ }).then((re) => {
|
|
|
+ this.clientDetailList = re.data.list;
|
|
|
+ // 取出手机号码是该负责人的
|
|
|
+ this.clientDetailList_mobile = this.clientDetailList.filter(
|
|
|
+ (item) => item.service_name == value
|
|
|
+ );
|
|
|
+ // 赋值默认手机号码
|
|
|
+ this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
|
|
|
+ // 去重手机号码
|
|
|
+ this.clientDetailList_mobile = this.unique(
|
|
|
+ this.clientDetailList_mobile
|
|
|
+ );
|
|
|
+ // 取出地址是该负责人的
|
|
|
+ this.clientDetailList_address = this.clientDetailList.filter(
|
|
|
+ (item) => item.service_name == value
|
|
|
+ );
|
|
|
+ // 赋值默认地址
|
|
|
+ this.info.custom_detail_id =
|
|
|
+ this.clientDetailList_address[0].id || 0;
|
|
|
+ this.info.service_id = re.data.detail.service_id;
|
|
|
+ this.fax = re.data.detail.fax;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ this.info.custom_detail_mobile = "";
|
|
|
+ this.info.custom_detail_id = "";
|
|
|
+ this.info.service_id = "";
|
|
|
+ this.clientDetailList_respon = JSON.parse(
|
|
|
+ JSON.stringify(this.charge_list)
|
|
|
);
|
|
|
- // 赋值默认地址
|
|
|
- this.info.custom_detail_id = this.clientDetailList_respon[0].id || 0;
|
|
|
+ this.clientList = JSON.parse(JSON.stringify(this.cus_list));
|
|
|
}
|
|
|
},
|
|
|
handleClientDetailChange(value) {
|
|
@@ -3768,13 +3869,17 @@ export default {
|
|
|
handleTotalPriceCalc(row, item) {
|
|
|
row.total_price = ((row.price || 0) * (row.num || 0)).toFixed(2);
|
|
|
let sum1 = 0;
|
|
|
- item.metalArray.forEach((element) => {
|
|
|
- sum1 += element.total_price * 1 || 0;
|
|
|
- });
|
|
|
+ item.metalArray &&
|
|
|
+ item.metalArray.length > 0 &&
|
|
|
+ item.metalArray.forEach((element) => {
|
|
|
+ sum1 += element.total_price * 1 || 0;
|
|
|
+ });
|
|
|
let sum2 = 0;
|
|
|
- item.extArray.forEach((element) => {
|
|
|
- sum2 += element.total_price * 1 || 0;
|
|
|
- });
|
|
|
+ item.extArray &&
|
|
|
+ item.extArray.length > 0 &&
|
|
|
+ item.extArray.forEach((element) => {
|
|
|
+ sum2 += element.total_price * 1 || 0;
|
|
|
+ });
|
|
|
item.ext_price = sum1 * 1 + sum2 * 1;
|
|
|
item.price =
|
|
|
(item.unit_price * 1 || 0) * (item.num * 1 || 1) +
|
|
@@ -3795,6 +3900,7 @@ export default {
|
|
|
},
|
|
|
handlePartsDele(element, index, array) {
|
|
|
array.splice(index, 1);
|
|
|
+ this.handleCalcCount();
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
handleProductPositionChange(item, e) {
|