|
@@ -111,7 +111,23 @@
|
|
|
></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="详细地址:" prop="address">
|
|
|
+ <FormItem label="负责人:">
|
|
|
+ <Select
|
|
|
+ placeholder="请选择负责人"
|
|
|
+ :disabled="type == 3"
|
|
|
+ @on-change="handleClientDetailChange"
|
|
|
+ v-model="info.custom_detail_id"
|
|
|
+ class="auto-width"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="item of clientDetailList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.service_name"
|
|
|
+ :value="item.id"
|
|
|
+ ></Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="详细地址:">
|
|
|
<Select
|
|
|
clearable
|
|
|
filterable
|
|
@@ -128,7 +144,7 @@
|
|
|
></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="手机号:" prop="mobile">
|
|
|
+ <FormItem label="手机号:">
|
|
|
<Select
|
|
|
clearable
|
|
|
filterable
|
|
@@ -160,6 +176,7 @@
|
|
|
></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
+
|
|
|
<FormItem v-if="formObjs.end_time" label="交付日期:">
|
|
|
<DatePicker
|
|
|
:options="options"
|
|
@@ -457,6 +474,12 @@
|
|
|
>
|
|
|
<template #default="{ row, rowIndex }">
|
|
|
<a
|
|
|
+ @click="handleSet(row, rowIndex, 5)"
|
|
|
+ v-show="type == 3"
|
|
|
+ style="margin: 0 5px"
|
|
|
+ >详情</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
@click="handleSet(row, rowIndex, 4)"
|
|
|
v-if="type != 3"
|
|
|
v-show="rowIndex >= 0"
|
|
@@ -470,12 +493,7 @@
|
|
|
style="margin: 0 5px"
|
|
|
>编辑</a
|
|
|
>
|
|
|
- <a
|
|
|
- @click="handleSet(row, rowIndex, 2)"
|
|
|
- v-show="rowIndex >= 0"
|
|
|
- style="margin: 0 5px"
|
|
|
- >详情</a
|
|
|
- >
|
|
|
+
|
|
|
<a
|
|
|
@click="handleSet(row, rowIndex, 3)"
|
|
|
v-if="type != 3"
|
|
@@ -514,7 +532,6 @@
|
|
|
<Button
|
|
|
@click="handleProductCopy"
|
|
|
size="small"
|
|
|
- v-show="!isEdit"
|
|
|
type="primary"
|
|
|
style="margin-right: 5px"
|
|
|
slot="extra"
|
|
@@ -523,7 +540,6 @@
|
|
|
<Button
|
|
|
@click="handleTabsAdd"
|
|
|
size="small"
|
|
|
- v-show="!isEdit"
|
|
|
type="warning"
|
|
|
style="margin-right: 5px"
|
|
|
slot="extra"
|
|
@@ -532,16 +548,13 @@
|
|
|
<Button
|
|
|
@click="handleProductDele"
|
|
|
size="small"
|
|
|
- v-show="!isEdit"
|
|
|
type="primary"
|
|
|
slot="extra"
|
|
|
>删除</Button
|
|
|
>
|
|
|
<TabPane
|
|
|
:label="
|
|
|
- (item.position == '' ? '位置' : item.position) +
|
|
|
- '-' +
|
|
|
- item.type_name
|
|
|
+ (item.position ? item.position : '位置') + '-' + item.type_name
|
|
|
"
|
|
|
v-for="(item, index) in modalArray"
|
|
|
:key="item.id"
|
|
@@ -1267,7 +1280,7 @@
|
|
|
<Tabs value="name">
|
|
|
<TabPane
|
|
|
:label="
|
|
|
- (modalData.position == '' ? '位置' : modalData.position) +
|
|
|
+ (modalData.position ? modalData.position : '位置') +
|
|
|
'-' +
|
|
|
modalData.type_name
|
|
|
"
|
|
@@ -1292,6 +1305,7 @@
|
|
|
clearable
|
|
|
transfer
|
|
|
label-in-value
|
|
|
+ :disabled="isCheck"
|
|
|
size="small"
|
|
|
v-model="modalData.product_id"
|
|
|
@on-change="changeEditProduct($event)"
|
|
@@ -1315,6 +1329,7 @@
|
|
|
<Input
|
|
|
size="small"
|
|
|
v-model="modalData.position"
|
|
|
+ :disabled="isCheck"
|
|
|
@on-change="
|
|
|
(e) => handleProductPositionChange(modalData, e)
|
|
|
"
|
|
@@ -1335,7 +1350,7 @@
|
|
|
<!-- 工艺属性 -->
|
|
|
<FormItem
|
|
|
v-for="(ele, idx) in modalData.process"
|
|
|
- :key="ele.key + '333' + modalData.id"
|
|
|
+ :key="idx + '333' + modalData.id"
|
|
|
:label="ele.title + ':'"
|
|
|
>
|
|
|
<Tooltip style="width: 120px" transfer>
|
|
@@ -1353,6 +1368,7 @@
|
|
|
clearable
|
|
|
transfer
|
|
|
label-in-value
|
|
|
+ :disabled="isCheck"
|
|
|
@on-open-change="
|
|
|
(e) => handleGetProductMeasure(e, idx, modalData, ele)
|
|
|
"
|
|
@@ -1383,6 +1399,7 @@
|
|
|
size="small"
|
|
|
type="text"
|
|
|
clearable
|
|
|
+ :disabled="isCheck"
|
|
|
:placeholder="ele.e_title"
|
|
|
v-model="ele.value"
|
|
|
@on-change="
|
|
@@ -1399,6 +1416,7 @@
|
|
|
size="small"
|
|
|
@on-change="(e) => handleProductNumChange(e, modalData)"
|
|
|
v-model="modalData.total_num"
|
|
|
+ :disabled="isCheck"
|
|
|
style="width: 120px"
|
|
|
placeholder="请输入产品数量"
|
|
|
/>
|
|
@@ -1407,6 +1425,7 @@
|
|
|
<Input
|
|
|
size="small"
|
|
|
v-model="modalData.num"
|
|
|
+ :disabled="isCheck"
|
|
|
style="width: 120px"
|
|
|
placeholder="自动带出"
|
|
|
/>
|
|
@@ -1414,6 +1433,7 @@
|
|
|
<FormItem label="单价:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="modalData.unit_price"
|
|
|
@on-change="
|
|
|
(e) => handleProductUnit_priceChange(e, modalData)
|
|
@@ -1425,6 +1445,7 @@
|
|
|
<FormItem label="附加金额:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="modalData.ext_price"
|
|
|
@on-change="
|
|
|
(e) => handleProductExt_priceChange(e, modalData)
|
|
@@ -1435,6 +1456,7 @@
|
|
|
</FormItem>
|
|
|
<FormItem label="超标金额:">
|
|
|
<Input
|
|
|
+ :disabled="isCheck"
|
|
|
size="small"
|
|
|
@on-change="
|
|
|
(e) => handleProductOver_priceChange(e, modalData)
|
|
@@ -1446,6 +1468,7 @@
|
|
|
</FormItem>
|
|
|
<FormItem label="金额:">
|
|
|
<Input
|
|
|
+ :disabled="isCheck"
|
|
|
size="small"
|
|
|
v-model="modalData.price"
|
|
|
style="width: 120px"
|
|
@@ -1455,6 +1478,7 @@
|
|
|
<FormItem label="图号:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="modalData.url_number"
|
|
|
style="width: 120px"
|
|
|
placeholder="自动带出"
|
|
@@ -1467,6 +1491,7 @@
|
|
|
>
|
|
|
<Input
|
|
|
v-show="_customize.type == 1"
|
|
|
+ :disabled="isCheck"
|
|
|
size="small"
|
|
|
type="text"
|
|
|
v-model="_customize.value"
|
|
@@ -1477,6 +1502,7 @@
|
|
|
<Select
|
|
|
v-show="_customize.type == 2"
|
|
|
style="width: 120px"
|
|
|
+ :disabled="isCheck"
|
|
|
filterable
|
|
|
clearable
|
|
|
v-model="_customize.value"
|
|
@@ -1542,6 +1568,7 @@
|
|
|
<Input
|
|
|
size="small"
|
|
|
type="textarea"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="modalData.remark"
|
|
|
style="width: 120px"
|
|
|
placeholder="请输入备注"
|
|
@@ -1580,6 +1607,7 @@
|
|
|
<FormItem :label-width="element.isBP ? 1 : 50">
|
|
|
<Radio
|
|
|
v-show="element.isBP"
|
|
|
+ :disabled="isCheck"
|
|
|
@click.native.prevent="handleRadioClick(element)"
|
|
|
v-model="element.isChoosed"
|
|
|
></Radio>
|
|
@@ -1590,6 +1618,7 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
transfer
|
|
|
+ :disabled="isCheck"
|
|
|
label-in-value
|
|
|
size="small"
|
|
|
@on-change="handlePartChange(element, modalData.measure)"
|
|
@@ -1608,6 +1637,7 @@
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.long"
|
|
|
style="width: 50px"
|
|
|
placeholder="请输入厚"
|
|
@@ -1617,6 +1647,7 @@
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.wide"
|
|
|
style="width: 50px"
|
|
|
placeholder="请输入宽"
|
|
@@ -1626,6 +1657,7 @@
|
|
|
<Input
|
|
|
size="small"
|
|
|
clearable
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.high"
|
|
|
style="width: 50px"
|
|
|
placeholder="请输入高"
|
|
@@ -1633,7 +1665,7 @@
|
|
|
</FormItem>
|
|
|
<FormItem
|
|
|
v-for="(process_detail, idx) in element.process"
|
|
|
- :key="process_detail.name + '555' + element.part_id"
|
|
|
+ :key="idx + '555' + element.part_id"
|
|
|
:label="process_detail.name + ':'"
|
|
|
>
|
|
|
<Tooltip style="width: 120px" transfer>
|
|
@@ -1650,6 +1682,7 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
label-in-value
|
|
|
+ :disabled="isCheck"
|
|
|
@on-change="
|
|
|
(e) => handlePartProcessChange(e, idx, element)
|
|
|
"
|
|
@@ -1669,6 +1702,7 @@
|
|
|
<Button
|
|
|
@click="handlePartsApart(element, idx, modalData.part)"
|
|
|
type="primary"
|
|
|
+ v-show="!isCheck"
|
|
|
v-if="element.isBP"
|
|
|
style="margin-right: 5px"
|
|
|
size="small"
|
|
@@ -1678,6 +1712,7 @@
|
|
|
@click="handlePartsDele(element, idx, modalData.part)"
|
|
|
type="primary"
|
|
|
v-else
|
|
|
+ v-show="!isCheck"
|
|
|
style="margin-right: 5px"
|
|
|
size="small"
|
|
|
>删除</Button
|
|
@@ -1688,7 +1723,11 @@
|
|
|
style="margin-right: 5px"
|
|
|
size="small"
|
|
|
>{{
|
|
|
- element.isShowPartDetail ? "收起" : "修改原材料"
|
|
|
+ element.isShowPartDetail
|
|
|
+ ? "收起"
|
|
|
+ : isCheck
|
|
|
+ ? "查看"
|
|
|
+ : "修改原材料"
|
|
|
}}</Button
|
|
|
>
|
|
|
</FormItem>
|
|
@@ -1764,6 +1803,7 @@
|
|
|
style="width: 80px"
|
|
|
filterable
|
|
|
clearable
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="ele.material_detail_id"
|
|
|
@on-change="(e) => handleMaterialChange(e, ele)"
|
|
|
placeholder="请选择厚"
|
|
@@ -1782,6 +1822,7 @@
|
|
|
style="width: 80px"
|
|
|
filterable
|
|
|
clearable
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="ele.material_detail_id"
|
|
|
placeholder="请选择厚"
|
|
|
size="small"
|
|
@@ -1799,6 +1840,7 @@
|
|
|
style="width: 80px"
|
|
|
filterable
|
|
|
clearable
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="ele.material_detail_id"
|
|
|
placeholder="请选择厚"
|
|
|
size="small"
|
|
@@ -1814,6 +1856,7 @@
|
|
|
<FormItem label="数量" :label-width="40">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="ele.material_detail_num"
|
|
|
style="width: 80px"
|
|
|
placeholder="请输入数量"
|
|
@@ -1834,12 +1877,14 @@
|
|
|
@click="handleExtraAdd(modalData.metalArray, 1)"
|
|
|
type="primary"
|
|
|
style="margin-right: 5px"
|
|
|
+ v-show="!isCheck"
|
|
|
size="small"
|
|
|
>新增五金</Button
|
|
|
>
|
|
|
<Button
|
|
|
@click="handleExtraAdd(modalData.extArray, 2)"
|
|
|
type="primary"
|
|
|
+ v-show="!isCheck"
|
|
|
size="small"
|
|
|
>新增附加项目</Button
|
|
|
>
|
|
@@ -1858,6 +1903,7 @@
|
|
|
transfer
|
|
|
label-in-value
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
@on-change="
|
|
|
(e) =>
|
|
|
handleMetalChange(
|
|
@@ -1881,6 +1927,7 @@
|
|
|
<FormItem label="数量:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.num"
|
|
|
@on-change="handleTotalPriceCalc(element, modalData)"
|
|
|
style="width: 100px"
|
|
@@ -1890,6 +1937,7 @@
|
|
|
<FormItem label="单价:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.price"
|
|
|
@on-change="handleTotalPriceCalc(element, modalData)"
|
|
|
style="width: 100px"
|
|
@@ -1899,6 +1947,7 @@
|
|
|
<FormItem label="金额:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.total_price"
|
|
|
style="width: 100px"
|
|
|
placeholder="请输入金额"
|
|
@@ -1907,6 +1956,7 @@
|
|
|
<FormItem label="备注:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.remark"
|
|
|
style="width: 100px"
|
|
|
placeholder="请输入备注"
|
|
@@ -1914,6 +1964,7 @@
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
<a
|
|
|
+ v-show="isCheck"
|
|
|
style="color: red"
|
|
|
@click="
|
|
|
handleExtraDele(modalData.metalArray, element, idx)
|
|
@@ -1934,6 +1985,7 @@
|
|
|
clearable
|
|
|
transfer
|
|
|
label-in-value
|
|
|
+ :disabled="isCheck"
|
|
|
size="small"
|
|
|
v-model="element.id"
|
|
|
@on-change="(e) => handleExtChange(element, e, modalData)"
|
|
@@ -1950,6 +2002,7 @@
|
|
|
<FormItem label="数量:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.num"
|
|
|
@on-change="handleTotalPriceCalc(element, modalData)"
|
|
|
style="width: 100px"
|
|
@@ -1959,6 +2012,7 @@
|
|
|
<FormItem label="单价:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.price"
|
|
|
@on-change="handleTotalPriceCalc(element, modalData)"
|
|
|
style="width: 100px"
|
|
@@ -1968,6 +2022,7 @@
|
|
|
<FormItem label="金额:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.total_price"
|
|
|
style="width: 100px"
|
|
|
placeholder="请输入金额"
|
|
@@ -1976,6 +2031,7 @@
|
|
|
<FormItem label="备注:">
|
|
|
<Input
|
|
|
size="small"
|
|
|
+ :disabled="isCheck"
|
|
|
v-model="element.remark"
|
|
|
style="width: 100px"
|
|
|
placeholder="请输入备注"
|
|
@@ -1984,6 +2040,7 @@
|
|
|
<FormItem>
|
|
|
<a
|
|
|
style="color: red"
|
|
|
+ v-show="isCheck"
|
|
|
@click="handleExtraDele(modalData.extArray, element, idx)"
|
|
|
>删除</a
|
|
|
>
|
|
@@ -1996,7 +2053,12 @@
|
|
|
</div>
|
|
|
<div slot="footer">
|
|
|
<Button @click="cancelModal">取消</Button>
|
|
|
- <Button @click="handleEditProductSubmit" type="primary">确定</Button>
|
|
|
+ <Button
|
|
|
+ @click="handleEditProductSubmit"
|
|
|
+ v-show="!isCheck"
|
|
|
+ type="primary"
|
|
|
+ >确定</Button
|
|
|
+ >
|
|
|
</div>
|
|
|
</Modal>
|
|
|
<Modal
|
|
@@ -2167,7 +2229,7 @@ export default {
|
|
|
currentTabIndex: "0",
|
|
|
parts_title_count: [],
|
|
|
wood_title_count: [],
|
|
|
- isEdit: false,
|
|
|
+ isCheck: false,
|
|
|
warningList: [],
|
|
|
process_Select_match_list: [], //选中的list
|
|
|
originalTableColumns: [
|
|
@@ -2352,7 +2414,6 @@ export default {
|
|
|
},
|
|
|
handleProductCopy() {
|
|
|
let idx = this.$refs.tabsRef.activeKey;
|
|
|
- console.log("idx :>> ", idx);
|
|
|
let obj = JSON.parse(JSON.stringify(this.modalArray[idx]));
|
|
|
obj.index = JSON.parse(JSON.stringify(this.modalArray.length));
|
|
|
this.modalArray.push(obj);
|
|
@@ -2639,6 +2700,7 @@ export default {
|
|
|
this.modalData.metalArray.map((item) => {
|
|
|
const obj = {
|
|
|
total_num: item.num,
|
|
|
+ title: item.title,
|
|
|
unit_price: item.price,
|
|
|
ext_price: item.num * item.price,
|
|
|
is_metal: false,
|
|
@@ -2712,7 +2774,8 @@ export default {
|
|
|
v.title == el.material_detail_title &&
|
|
|
v.measure_str.map((item) => {
|
|
|
item.id == el.material_detail_id &&
|
|
|
- (item.num = item.num + el.num);
|
|
|
+ (item.num =
|
|
|
+ item.num * 1 + el.material_detail_num * 1);
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
@@ -2725,7 +2788,7 @@ export default {
|
|
|
v.title == el.material_detail_title &&
|
|
|
((v.unit = __temp[0].unit),
|
|
|
v.measure_str.push({
|
|
|
- num: el.num,
|
|
|
+ num: el.material_detail_num,
|
|
|
id: __temp[0].material_detail_id,
|
|
|
measure: `${__temp[0].long || 0}*${__temp[0].wide ||
|
|
|
0}*${__temp[0].high || 0}`,
|
|
@@ -2748,7 +2811,7 @@ export default {
|
|
|
unit: total_line_unit,
|
|
|
measure_str: [
|
|
|
{
|
|
|
- num: el.num,
|
|
|
+ num: el.material_detail_num,
|
|
|
id: _temp[0].material_detail_id,
|
|
|
measure: `${_temp[0].long || 0}*${_temp[0].wide ||
|
|
|
0}*${_temp[0].high || 0}`,
|
|
@@ -2790,7 +2853,15 @@ export default {
|
|
|
this.axios("/api/employee_list").then((res) => (this.users = res.data));
|
|
|
},
|
|
|
handleExtraAdd(array, type) {
|
|
|
- array.push({ num: 0, price: 0, total_price: 0, type, remark: "" });
|
|
|
+ array.push({
|
|
|
+ num: 0,
|
|
|
+ price: 0,
|
|
|
+ total_price: 0,
|
|
|
+ type,
|
|
|
+ remark: "",
|
|
|
+ title: "",
|
|
|
+ is_metal: true,
|
|
|
+ });
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
handleExtraDele(array, row, index) {
|
|
@@ -2875,20 +2946,21 @@ export default {
|
|
|
return sums;
|
|
|
},
|
|
|
handleMetalChange(e, row, n, arr) {
|
|
|
- row.ext_id = e.value;
|
|
|
- row.title = e.label;
|
|
|
+ arr[n].ext_id = e.value;
|
|
|
+ arr[n].title = e.label;
|
|
|
},
|
|
|
handleClientDetailChange(value) {
|
|
|
if (value) {
|
|
|
let row = this.clientDetailList.filter((item) => item.id == value);
|
|
|
this.info.address = row[0].address;
|
|
|
+ this.info.address = row[0].address;
|
|
|
this.info.mobile = row[0].mobile;
|
|
|
this.$forceUpdate();
|
|
|
}
|
|
|
},
|
|
|
getEditData(modalData, curData) {
|
|
|
- // console.log('modalData :>> ', modalData);
|
|
|
- // console.log('curData :>> ', curData);
|
|
|
+ // console.log("modalData :>> ", modalData);
|
|
|
+ // console.log("curData :>> ", curData);
|
|
|
modalData.ext_price = curData.ext_price * 1 || 0;
|
|
|
modalData.model = curData.model;
|
|
|
modalData.num = curData.num || 1;
|
|
@@ -2949,7 +3021,6 @@ export default {
|
|
|
curData.ext = curData.ext_list;
|
|
|
}
|
|
|
curData.ext.forEach((element) => {
|
|
|
- console.log("element :>> ", element);
|
|
|
element.type == 1 && modalData.metalArray.push(element);
|
|
|
element.type == 2 && modalData.extArray.push(element);
|
|
|
});
|
|
@@ -2962,47 +3033,47 @@ export default {
|
|
|
element.total_price = (element.price * element.num).toFixed(2);
|
|
|
});
|
|
|
// 同步 curData 、 modalData
|
|
|
- for (
|
|
|
- let _modal_idx = 0;
|
|
|
- _modal_idx < modalData.part.length;
|
|
|
- _modal_idx++
|
|
|
- ) {
|
|
|
- const _modal = modalData.part[_modal_idx];
|
|
|
- //匹配次数
|
|
|
- let match_idx = -1;
|
|
|
- // 相同次数
|
|
|
- let same_idx = 0;
|
|
|
- for (let _cur_idx = 0; _cur_idx < curData.part.length; _cur_idx++) {
|
|
|
- const _cur = curData.part[_cur_idx];
|
|
|
- if (
|
|
|
- _modal.part_id == _cur.part_id ||
|
|
|
- _modal.change_id == _cur.change_id
|
|
|
- ) {
|
|
|
- match_idx++;
|
|
|
- }
|
|
|
- if (match_idx == 1) {
|
|
|
- _modal.splice(
|
|
|
- _modal_idx,
|
|
|
- same_idx,
|
|
|
- JSON.parse(JSON.stringify(_cur))
|
|
|
- );
|
|
|
- match_idx--;
|
|
|
- same_idx++;
|
|
|
- _modal_idx++;
|
|
|
- }
|
|
|
- }
|
|
|
- if (match_idx == -1) {
|
|
|
- //modal存在但是cur不存在数据
|
|
|
- curData.part.splice(
|
|
|
- _modal_idx,
|
|
|
- 0,
|
|
|
- JSON.parse(JSON.stringify(_modal))
|
|
|
- );
|
|
|
- modalData.isChoosed = false;
|
|
|
- } else if (match_idx == 0) {
|
|
|
- // modal 与 cur数量一致
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (
|
|
|
+ // let _modal_idx = 0;
|
|
|
+ // _modal_idx < modalData.part.length;
|
|
|
+ // _modal_idx++
|
|
|
+ // ) {
|
|
|
+ // const _modal = modalData.part[_modal_idx];
|
|
|
+ // //匹配次数
|
|
|
+ // let match_idx = -1;
|
|
|
+ // // 相同次数
|
|
|
+ // let same_idx = 0;
|
|
|
+ // for (let _cur_idx = 0; _cur_idx < curData.part.length; _cur_idx++) {
|
|
|
+ // const _cur = curData.part[_cur_idx];
|
|
|
+ // if (
|
|
|
+ // _modal.part_id == _cur.part_id ||
|
|
|
+ // _modal.change_id == _cur.change_id
|
|
|
+ // ) {
|
|
|
+ // match_idx++;
|
|
|
+ // }
|
|
|
+ // if (match_idx == 1) {
|
|
|
+ // _modal.splice(
|
|
|
+ // _modal_idx,
|
|
|
+ // same_idx,
|
|
|
+ // JSON.parse(JSON.stringify(_cur))
|
|
|
+ // );
|
|
|
+ // match_idx--;
|
|
|
+ // same_idx++;
|
|
|
+ // _modal_idx++;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (match_idx == -1) {
|
|
|
+ // //modal存在但是cur不存在数据
|
|
|
+ // curData.part.splice(
|
|
|
+ // _modal_idx,
|
|
|
+ // 0,
|
|
|
+ // JSON.parse(JSON.stringify(_modal))
|
|
|
+ // );
|
|
|
+ // modalData.isChoosed = false;
|
|
|
+ // } else if (match_idx == 0) {
|
|
|
+ // // modal 与 cur数量一致
|
|
|
+ // }
|
|
|
+ // }
|
|
|
// 处理部件
|
|
|
curData.part.forEach((element, index) => {
|
|
|
if (!element.is_metal) {
|
|
@@ -3048,7 +3119,7 @@ export default {
|
|
|
},
|
|
|
handleSet(row, index, type) {
|
|
|
let obj;
|
|
|
- // 1 新增 2 编辑 3 删除 4复制
|
|
|
+ // 1 新增 2 编辑 3 删除 4复制 5详情
|
|
|
switch (type) {
|
|
|
case 1:
|
|
|
this.title_state = 1;
|
|
@@ -3065,19 +3136,18 @@ export default {
|
|
|
];
|
|
|
this.currentTabIndex = "0";
|
|
|
this.showAddProduct = true;
|
|
|
- this.isEdit = false;
|
|
|
} else {
|
|
|
this.$Message.warning("请先选择客户");
|
|
|
}
|
|
|
break;
|
|
|
case 2:
|
|
|
this.title_state = 2;
|
|
|
- this.isEdit = true;
|
|
|
+ this.isCheck = false;
|
|
|
if (this.type == 1) {
|
|
|
+ this.showEditProduct = true;
|
|
|
this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
this.currencyIndex = index;
|
|
|
} else if (this.type == 2) {
|
|
|
- console.log("row :>> ", row);
|
|
|
if (row.get_first_data) {
|
|
|
this.axios
|
|
|
.get("/api/order_product_detail_new", {
|
|
@@ -3085,7 +3155,6 @@ export default {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- res.data.value = res.data.product_id;
|
|
|
this.currencyIndex = index;
|
|
|
this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
this.editForm = res.data;
|
|
@@ -3109,7 +3178,27 @@ export default {
|
|
|
this.tableData.splice(index, 0, obj);
|
|
|
this.handleCalcCount();
|
|
|
break;
|
|
|
- default:
|
|
|
+ case 5:
|
|
|
+ this.title_state = 3;
|
|
|
+ this.isCheck = true;
|
|
|
+ if (row.get_first_data) {
|
|
|
+ this.axios
|
|
|
+ .get("/api/order_product_detail_new", {
|
|
|
+ params: { order_product_id: row.order_product_id },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.currencyIndex = index;
|
|
|
+ this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
+ this.editForm = res.data;
|
|
|
+ this.changeProductOnEdit(res.data, 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
+ this.currencyIndex = index;
|
|
|
+ this.showEditProduct = true;
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
@@ -3212,7 +3301,7 @@ export default {
|
|
|
item.position = e.target.value;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
- changeAddProduct(row, n, ext) {
|
|
|
+ changeAddProduct(row, n) {
|
|
|
if (row) {
|
|
|
let id = row ? row.value : this.productList[0].id;
|
|
|
this.modalArray[n].type_name = row.label;
|
|
@@ -3268,14 +3357,6 @@ export default {
|
|
|
// modalData.model = res.data.model || ''
|
|
|
// modalData.same_process_compare = JSON.parse(JSON.stringify(res.data.intermediate.same_process || []))
|
|
|
modalData.selected_ids = [];
|
|
|
- if (!ext) {
|
|
|
- if (row) {
|
|
|
- modalData.title = row.label || "";
|
|
|
- }
|
|
|
- modalData.measuring = res.data.measuring;
|
|
|
- modalData.customize = res.data.customize;
|
|
|
- modalData.product_remake = res.data.product_remake;
|
|
|
- }
|
|
|
modalData.part = res.data.part;
|
|
|
modalData.part.forEach((element, index) => {
|
|
|
if (!element.is_metal) {
|
|
@@ -3554,14 +3635,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
|
- changeProductOnEdit(row, n, ext) {
|
|
|
+ changeProductOnEdit(row, n) {
|
|
|
if (row) {
|
|
|
- let id = row ? row.value : this.productList[0].id;
|
|
|
this.modalData.type_name = row.label;
|
|
|
this.modalData.title = row.label;
|
|
|
this.axios("/api/order_get_product_detail_new", {
|
|
|
- params: { product_id: id, custom_id: 8 },
|
|
|
+ params: {
|
|
|
+ product_id: row.product_id,
|
|
|
+ custom_id: this.info.custom_id,
|
|
|
+ },
|
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.process_match_list = res.data.process.list;
|
|
@@ -3571,7 +3655,7 @@ export default {
|
|
|
this.modalData.unit_price = res.data.price || 0;
|
|
|
this.modalData.num = res.data.num || 1;
|
|
|
this.modalData.over_price = res.data.over_price || 0;
|
|
|
- this.modalData.position = res.data.position || "";
|
|
|
+ this.modalData.position = res.data.position | "";
|
|
|
this.modalData.unit = res.data.unit || "";
|
|
|
this.modalData.remark = res.data.remark || "";
|
|
|
this.modalData.url = res.data.url || [];
|
|
@@ -3579,13 +3663,6 @@ export default {
|
|
|
this.modalData.overdraft = res.data.overdraft;
|
|
|
// this.modalData.same_process_compare = JSON.parse(JSON.stringify(res.data.intermediate.same_process || []))
|
|
|
this.modalData.selected_ids = [];
|
|
|
- if (!ext) {
|
|
|
- if (row) {
|
|
|
- this.modalData.title = row.label || "";
|
|
|
- }
|
|
|
- this.modalData.measuring = res.data.measuring;
|
|
|
- this.modalData.product_remake = res.data.product_remake;
|
|
|
- }
|
|
|
this.modalData.customize = row.customize;
|
|
|
this.modalData.get_first_data = false;
|
|
|
this.modalData.part = res.data.part;
|
|
@@ -3657,7 +3734,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- this.type == 2 && this.getEditData(this.modalData, this.editForm);
|
|
|
+ (this.type == 2 || this.type == 3) &&
|
|
|
+ this.getEditData(this.modalData, this.editForm);
|
|
|
this.showEditProduct = true;
|
|
|
this.$forceUpdate();
|
|
|
});
|
|
@@ -3765,6 +3843,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleProductNumChange(e, product) {
|
|
|
+ product.part.map((element) => {
|
|
|
+ element.part_detail.map((elem) => {
|
|
|
+ elem.material_detail_num *= e.target.value;
|
|
|
+ });
|
|
|
+ });
|
|
|
product.num = product.total_num = e.target.value;
|
|
|
product.price =
|
|
|
(product.unit_price * 1 || 0) * (product.num * 1 || 1) +
|
|
@@ -4055,7 +4138,7 @@ export default {
|
|
|
//修改材质/颜/工艺的disbled
|
|
|
handleProductProcessChange(e, n, modelData, ele) {
|
|
|
if (e) {
|
|
|
- this.pre_process_obj[n] = e.value;
|
|
|
+ this.pre_process_obj[n + 1] = e.value;
|
|
|
if (!modelData.procedure_properties_str) {
|
|
|
modelData.procedure_properties_str = [];
|
|
|
}
|