Commit 216c66cd by zhangxw

产品管理新增编辑产品。修改服务项目字段位置,修改采购成本自动赋值逻辑

1 parent 587ccbbc
...@@ -70,6 +70,13 @@ ...@@ -70,6 +70,13 @@
<span>质保时间/年</span> <span>质保时间/年</span>
<div class="resize-handle" @mousedown="onResizeStart"></div> <div class="resize-handle" @mousedown="onResizeStart"></div>
</td> </td>
<!-- 仅权益升级类目且供应方位广联直营展示 -->
<td v-if="equitySceneType.includes(goodsInfoData.goodsType) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)" style="position: relative">
<span class="color-red">*</span>
<span>服务项目</span>
<img v-if="$$(goodsInfoData.goodsSpecificationList, 'length') && goodsInfoData.goodsSpecificationList.filter(item => item.checked).length > 0" src="@/assets/icon-edit.png" style="cursor: pointer; margin-left: 5px; width: 16px; height: 16px; vertical-align: middle" @click="serviceSelectFocus()" />
<div class="resize-handle" @mousedown="onResizeStart"></div>
</td>
<td style="position: relative"> <td style="position: relative">
<span class="color-red">*</span> <span class="color-red">*</span>
<span>采购成本/元</span> <span>采购成本/元</span>
...@@ -90,13 +97,6 @@ ...@@ -90,13 +97,6 @@
<span>适用区域</span> <span>适用区域</span>
<div class="resize-handle" @mousedown="onResizeStart"></div> <div class="resize-handle" @mousedown="onResizeStart"></div>
</td> </td>
<!-- 仅权益升级类目且供应方位广联直营展示 -->
<td v-if="equitySceneType.includes(goodsInfoData.goodsType) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)" style="position: relative">
<span class="color-red">*</span>
<span>服务项目</span>
<img v-if="$$(goodsInfoData.goodsSpecificationList, 'length') && goodsInfoData.goodsSpecificationList.filter(item => item.checked).length > 0" src="@/assets/icon-edit.png" style="cursor: pointer; margin-left: 5px; width: 16px; height: 16px; vertical-align: middle" @click="serviceSelectFocus()" />
<div class="resize-handle" @mousedown="onResizeStart"></div>
</td>
<td style="position: relative"> <td style="position: relative">
<span>{{ membraneTypeList.includes(goodsInfoData.goodsType) ? '参考售价(元)/车' : '参考售价(元)/件' }}</span> <span>{{ membraneTypeList.includes(goodsInfoData.goodsType) ? '参考售价(元)/车' : '参考售价(元)/件' }}</span>
<div class="resize-handle" @mousedown="onResizeStart"></div> <div class="resize-handle" @mousedown="onResizeStart"></div>
...@@ -184,6 +184,10 @@ ...@@ -184,6 +184,10 @@
<td> <td>
<el-input v-model="row.item.warrantyPeriod" class="w-150-per" :class="{ 'border-red': (!isEquityOrExtendType && filterEmpty(row.item.warrantyPeriod) && row.item.warrantyPeriodEmpty) || row.item.warrantyPeriodRangeError }" placeholder="0-100" size="small" @blur="handleWarrantyPeriodBlur($event, row.originalIndex)" @input="handleWarrantyPeriodInput($event, row.originalIndex)"></el-input> <el-input v-model="row.item.warrantyPeriod" class="w-150-per" :class="{ 'border-red': (!isEquityOrExtendType && filterEmpty(row.item.warrantyPeriod) && row.item.warrantyPeriodEmpty) || row.item.warrantyPeriodRangeError }" placeholder="0-100" size="small" @blur="handleWarrantyPeriodBlur($event, row.originalIndex)" @input="handleWarrantyPeriodInput($event, row.originalIndex)"></el-input>
</td> </td>
<!-- 权益服务项目 -->
<td v-if="equitySceneType.includes(goodsInfoData.goodsType) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)">
<el-select :ref="`serviceSelect${row.originalIndex}`" v-model="row.item.serviceItemArr" class="w-150-per" :class="{ 'border-red': filterEmpty(row.item.serviceItemArr) && row.item.serviceItemArrEmpty }" collapse-tags multiple placeholder="服务项目" :popper-append-to-body="false" popper-class="service_select_class" size="small" style="width: 150px" @focus="serviceSelectFocus($event, row.originalIndex)"></el-select>
</td>
<td> <td>
<el-input v-model="row.item.purchaseCost" class="w-150-per" :class="{ 'border-red': (filterEmpty(row.item.purchaseCost) && row.item.purchaseCostEmpty) || row.item.purchaseCostRangeError }" placeholder="0-1000000" size="small" @blur="handlePurchaseCostBlur($event, row.originalIndex)" @input="handlePurchaseCostInput($event, row.originalIndex)"></el-input> <el-input v-model="row.item.purchaseCost" class="w-150-per" :class="{ 'border-red': (filterEmpty(row.item.purchaseCost) && row.item.purchaseCostEmpty) || row.item.purchaseCostRangeError }" placeholder="0-1000000" size="small" @blur="handlePurchaseCostBlur($event, row.originalIndex)" @input="handlePurchaseCostInput($event, row.originalIndex)"></el-input>
</td> </td>
...@@ -203,10 +207,6 @@ ...@@ -203,10 +207,6 @@
@change="val => onApplicableAreaChange(val, row.originalIndex)" /> --> @change="val => onApplicableAreaChange(val, row.originalIndex)" /> -->
<ApplicableAreaQuerySelect v-model="row.item.upgradeGoodsAreaList" :options="applicableAreaList" width="calc(100% - 40px)" :custom-class="!row.item.upgradeGoodsAreaList.length && row.item.applicableAreaEmpty ? 'border-red' : ''" @visible-change="visible => onApplicableAreaVisibleChange(visible, row.originalIndex)" @before-change="payload => onApplicableAreaBeforeChange(payload, row.originalIndex)" @change="val => onApplicableAreaChange(val, row.originalIndex)" /> <ApplicableAreaQuerySelect v-model="row.item.upgradeGoodsAreaList" :options="applicableAreaList" width="calc(100% - 40px)" :custom-class="!row.item.upgradeGoodsAreaList.length && row.item.applicableAreaEmpty ? 'border-red' : ''" @visible-change="visible => onApplicableAreaVisibleChange(visible, row.originalIndex)" @before-change="payload => onApplicableAreaBeforeChange(payload, row.originalIndex)" @change="val => onApplicableAreaChange(val, row.originalIndex)" />
</td> </td>
<!-- 权益服务项目 -->
<td v-if="equitySceneType.includes(goodsInfoData.goodsType) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)">
<el-select :ref="`serviceSelect${row.originalIndex}`" v-model="row.item.serviceItemArr" class="w-150-per" :class="{ 'border-red': filterEmpty(row.item.serviceItemArr) && row.item.serviceItemArrEmpty }" collapse-tags multiple placeholder="服务项目" :popper-append-to-body="false" popper-class="service_select_class" size="small" style="width: 150px" @focus="serviceSelectFocus($event, row.originalIndex)"></el-select>
</td>
<td> <td>
<div style="transform: translateX(6px)"> <div style="transform: translateX(6px)">
<el-input v-model="row.item.upgradePrice" class="w-150-per" placeholder="请输入" size="small" @input="handlePrice($event, row.originalIndex, 'upgradePrice')"></el-input> <el-input v-model="row.item.upgradePrice" class="w-150-per" placeholder="请输入" size="small" @input="handlePrice($event, row.originalIndex, 'upgradePrice')"></el-input>
...@@ -891,7 +891,10 @@ export default { ...@@ -891,7 +891,10 @@ export default {
djCost = this.highPrecisionAdd(data?.map(i => i.djCost)) djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
if (!data?.length) djCost = '' if (!data?.length) djCost = ''
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'serviceItemArr', data) this.$set(this.goodsInfoData.goodsSpecificationList[index], 'serviceItemArr', data)
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'djCost', djCost) this.$set(this.goodsInfoData.goodsSpecificationList[index], 'djCost', djCost)
this.$set(this.goodsInfoData.goodsSpecificationList[index], "purchaseCost", djCost);
// 采购成本变更后重新计算运营成本
this.updateOperationCostFromInputs(index);
this.$nextTick(() => this.filterServiceForIndices([index])) this.$nextTick(() => this.filterServiceForIndices([index]))
this.serviceSelectIndex = null this.serviceSelectIndex = null
this.serviceSelected = [] this.serviceSelected = []
......
...@@ -45,6 +45,16 @@ ...@@ -45,6 +45,16 @@
<span>质保时间/年</span> <span>质保时间/年</span>
<div class="resize-handle" @mousedown="onResizeStart"></div> <div class="resize-handle" @mousedown="onResizeStart"></div>
</td> </td>
<!-- 仅权益升级类目且供应方位广联直营展示 -->
<td v-if="equitySceneType.includes(goodsInfoData.goodsType) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)" style="position: relative">
<span class="color-red">*</span>
<span>服务项目</span>
<img v-if="$$(goodsInfoData.goodsSpecificationSingleList, 'length') && goodsInfoData.goodsSpecificationSingleList.filter(item => item.checked).length > 0"
src="@/assets/icon-edit.png"
style="cursor: pointer; margin-left: 5px; width: 16px; height: 16px; vertical-align: middle"
@click="serviceSelectFocus()" />
<div class="resize-handle" @mousedown="onResizeStart"></div>
</td>
<td style="position: relative"> <td style="position: relative">
<span class="color-red">*</span> <span class="color-red">*</span>
<span>采购成本/元</span> <span>采购成本/元</span>
...@@ -65,16 +75,6 @@ ...@@ -65,16 +75,6 @@
<span>适用区域</span> <span>适用区域</span>
<div class="resize-handle" @mousedown="onResizeStart"></div> <div class="resize-handle" @mousedown="onResizeStart"></div>
</td> </td>
<!-- 仅权益升级类目且供应方位广联直营展示 -->
<td v-if="equitySceneType.includes(goodsInfoData.goodsType) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)" style="position: relative">
<span class="color-red">*</span>
<span>服务项目</span>
<img v-if="$$(goodsInfoData.goodsSpecificationSingleList, 'length') && goodsInfoData.goodsSpecificationSingleList.filter(item => item.checked).length > 0"
src="@/assets/icon-edit.png"
style="cursor: pointer; margin-left: 5px; width: 16px; height: 16px; vertical-align: middle"
@click="serviceSelectFocus()" />
<div class="resize-handle" @mousedown="onResizeStart"></div>
</td>
<td style="position: relative"> <td style="position: relative">
<!-- 膜类单位是车 其余为件 --> <!-- 膜类单位是车 其余为件 -->
<span>{{ membraneTypeList.includes(goodsInfoData.goodsType) ? '参考售价(元)/车' : '参考售价(元)/件' }}</span> <span>{{ membraneTypeList.includes(goodsInfoData.goodsType) ? '参考售价(元)/车' : '参考售价(元)/件' }}</span>
...@@ -229,6 +229,22 @@ ...@@ -229,6 +229,22 @@
@input="handleWarrantyPeriodInput($event, row.originalIndex)"> @input="handleWarrantyPeriodInput($event, row.originalIndex)">
</el-input> </el-input>
</td> </td>
<!-- 权益服务项目 -->
<td v-if="equitySceneType.includes(goodsInfoData.goodsType) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)">
<el-select :ref="`serviceSelect${row.originalIndex}`"
v-model="row.item.serviceItemArr"
class="w-150-per"
:class="{ 'border-red': filterEmpty(row.item.serviceItemArr) && row.item.serviceItemArrEmpty }"
collapse-tags
multiple
placeholder="服务项目"
:popper-append-to-body="false"
popper-class="service_select_class"
size="small"
style="width: 150px; transform: translateX(0)"
@focus="serviceSelectFocus($event, row.originalIndex)">
</el-select>
</td>
<td> <td>
<el-input v-model="row.item.purchaseCost" <el-input v-model="row.item.purchaseCost"
class="w-150-per" class="w-150-per"
...@@ -274,22 +290,6 @@ ...@@ -274,22 +290,6 @@
@before-change="payload => onApplicableAreaBeforeChange(payload, row.originalIndex)" @before-change="payload => onApplicableAreaBeforeChange(payload, row.originalIndex)"
@change="val => onApplicableAreaChange(val, row.originalIndex)" /> @change="val => onApplicableAreaChange(val, row.originalIndex)" />
</td> </td>
<!-- 权益服务项目 -->
<td v-if="equitySceneType.includes(goodsInfoData.goodsType) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)">
<el-select :ref="`serviceSelect${row.originalIndex}`"
v-model="row.item.serviceItemArr"
class="w-150-per"
:class="{ 'border-red': filterEmpty(row.item.serviceItemArr) && row.item.serviceItemArrEmpty }"
collapse-tags
multiple
placeholder="服务项目"
:popper-append-to-body="false"
popper-class="service_select_class"
size="small"
style="width: 150px; transform: translateX(0)"
@focus="serviceSelectFocus($event, row.originalIndex)">
</el-select>
</td>
<td> <td>
<el-input v-model="row.item.upgradePrice" <el-input v-model="row.item.upgradePrice"
class="w-150-per" class="w-150-per"
...@@ -989,6 +989,9 @@ export default { ...@@ -989,6 +989,9 @@ export default {
djCost = ""; djCost = "";
this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], "serviceItemArr", data); this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], "serviceItemArr", data);
this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], "djCost", djCost); this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], "djCost", djCost);
this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], "purchaseCost", djCost);
// 采购成本变更后重新计算运营成本
this.updateOperationCostFromInputs(index);
this.$nextTick(() => this.filterServiceForIndices([index])); this.$nextTick(() => this.filterServiceForIndices([index]));
this.serviceSelectIndex = null; this.serviceSelectIndex = null;
this.serviceSelected = []; this.serviceSelected = [];
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!