Compare commits
No commits in common. "6c95ddf924ba628ef90ec7fa9ddb49271c99fce6" and "76cd127fc737b2ea22b42ead2dd74861f86598af" have entirely different histories.
6c95ddf924
...
76cd127fc7
|
@ -1,47 +0,0 @@
|
|||
package com.ruoyi.web.controller.quote;
|
||||
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.quote.domain.MaterialDto;
|
||||
import com.ruoyi.quote.service.QuoteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.utils.PageUtils.startPage;
|
||||
|
||||
/**
|
||||
* @ClassName QuoteController
|
||||
* @Description TODO
|
||||
* @Author JIAL
|
||||
* @Date 2024/3/5 12:57
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/quote")
|
||||
@DataSource(DataSourceType.QUOT)
|
||||
public class QuoteController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
QuoteService quoteService;
|
||||
|
||||
@PostMapping("/materialList")
|
||||
public TableDataInfo queryMaterialListByParam(@RequestParam("precMaterialName") String precMaterialName,
|
||||
@RequestParam("vagueMaterialName") String vagueMaterialName,
|
||||
@RequestParam("vagueModel") String vagueModel) {
|
||||
startPage();
|
||||
logger.info(precMaterialName + vagueMaterialName + vagueModel);
|
||||
List<MaterialDto> materialDtos = quoteService.queryMaterialListByParam(precMaterialName,
|
||||
vagueMaterialName, vagueModel);
|
||||
|
||||
System.out.println("打通接口");
|
||||
return getDataTable(materialDtos);
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package com.ruoyi.quote.domain;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
public class MaterialDto extends BaseEntity {
|
||||
|
||||
private String uid; //物料uid
|
||||
|
||||
private String prodCategory; //产品大类
|
||||
|
||||
private String prodWorkshop; //生产车间
|
||||
|
||||
private String model; //型号
|
||||
|
||||
private String specification; //规格
|
||||
|
||||
private String voltLevel; //电压等级
|
||||
|
||||
private String measureUnit; //单位
|
||||
|
||||
private String matCostPrice; //材料成本价格
|
||||
|
||||
private String redBookPrice; //红本价格
|
||||
|
||||
private String redBookCost; //红本成本
|
||||
|
||||
private String rbFacPrice; //红本厂价
|
||||
|
||||
private String manuCost; //制造成本
|
||||
|
||||
private String wdFSurcharge; //盘具点数
|
||||
|
||||
private Integer number = 1; //数量默认1
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
package com.ruoyi.quote.mapper;
|
||||
|
||||
import com.ruoyi.quote.domain.MaterialDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName QuoteMapper
|
||||
* @Description TODO
|
||||
* @Author JIAL
|
||||
* @Date 2024/3/5 16:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface QuoteMapper {
|
||||
|
||||
@Select("select a.material_id AS uid, a.material_xingh AS model,a.material_guig AS specification,a.material_diany AS voltLevel,a.material_dw AS measureUnit,c.type_name AS prodCategory,\n" +
|
||||
"b.price matCostPrice, d.factory_total_ratio/100 manuCost,d.factory_pj_ratio/100 wdFSurcharge,\n" +
|
||||
"cc.红本价格 AS redBookPrice,cc.红本价格*0.8 rbFacPrice,dd.成本价格 AS redBookCost\n" +
|
||||
"from c_material a \n" +
|
||||
"left join \n" +
|
||||
"(select a.cost_material_id,sum((isnull(a.cost_cl_qty,0)+isnull(a.cost_cl_qty_2,0))*b.material_price) price from c_material_cost a\n" +
|
||||
"left join c_yl_material b on a.cost_cl_id=b.material_no\n" +
|
||||
"group by a.cost_material_id\n" +
|
||||
")b on a.material_id=b.cost_material_id\n" +
|
||||
"left join c_material_type_factory c on a.material_type_id = c.type_no\n" +
|
||||
"left join c_factory d on d.factory_no = c.factory_id\n" +
|
||||
"left join(select 型号,规格,电压等级,红本价格 from [REDBOOK].[RedBook].[dbo].rb_product_price \n" +
|
||||
" where version_uid_0 = (select max(version_uid_0) from [REDBOOK].[RedBook].[dbo].rb_product_price a\n" +
|
||||
" left join [REDBOOK].[RedBook].[dbo].rb_productVersion b on b.uid_0 = a.version_uid_0\n" +
|
||||
" where b.tong_price_0 ='70') and 型号 like '$%{vagueMaterialName}%' \n" +
|
||||
")as cc on cc.型号=a.material_xingh collate Chinese_PRC_CI_AS and cc.规格 = a.material_guig collate Chinese_PRC_CI_AS \n" +
|
||||
"and cc.电压等级 = a.material_diany collate Chinese_PRC_CI_AS\n" +
|
||||
"\n" +
|
||||
"left join(select 型号,规格,电压等级,成本价格 from [REDBOOK].[RedBook].[dbo].rb_productbase_price \n" +
|
||||
" where version_uid_0 = (select max(version_uid_0) from [REDBOOK].[RedBook].[dbo].rb_product_price a\n" +
|
||||
" left join [REDBOOK].[RedBook].[dbo].rb_productVersion b on b.uid_0 = a.version_uid_0\n" +
|
||||
" where b.tong_price_0 ='70') and 型号 like '$%{vagueMaterialName}%' \n" +
|
||||
")as dd on dd.型号=a.material_xingh collate Chinese_PRC_CI_AS and dd.规格 = a.material_guig collate Chinese_PRC_CI_AS \n" +
|
||||
" and dd.电压等级= a.material_diany collate Chinese_PRC_CI_AS\n" +
|
||||
"where a.material_xingh like '${precMaterialName}%' AND a.material_xingh like '%${vagueMaterialName}%' AND a.material_guig like '%${vagueModel}%'"
|
||||
)
|
||||
List<MaterialDto> queryMaterialListByParam(@Param("precMaterialName") String precMaterialName,
|
||||
@Param("vagueMaterialName")String vagueMaterialName,
|
||||
@Param("vagueModel") String vagueModel);
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.ruoyi.quote.service;
|
||||
|
||||
import com.ruoyi.quote.domain.MaterialDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName QuoteService
|
||||
* @Description TODO
|
||||
* @Author JIAL
|
||||
* @Date 2024/3/5 16:06
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface QuoteService {
|
||||
List<MaterialDto> queryMaterialListByParam(String precMaterialName, String vagueMaterialName, String vagueModel);
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package com.ruoyi.quote.service.impl;
|
||||
|
||||
import com.ruoyi.quote.domain.MaterialDto;
|
||||
import com.ruoyi.quote.mapper.QuoteMapper;
|
||||
import com.ruoyi.quote.service.QuoteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName QuoteServiceImpl
|
||||
* @Description TODO
|
||||
* @Author JIAL
|
||||
* @Date 2024/3/5 16:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class QuoteServiceImpl implements QuoteService {
|
||||
@Autowired
|
||||
QuoteMapper quoteMapper;
|
||||
|
||||
/**
|
||||
* @title queryMaterialListByParam
|
||||
* @description 根据条件查询物料信息
|
||||
* @author JIAL
|
||||
* @param: precMaterialName
|
||||
* @param: vagueMaterialName
|
||||
* @param: vagueModel
|
||||
* @updateTime 2024/3/5 16:16
|
||||
* @return: java.util.List<com.ruoyi.quote.domain.MaterialDto>
|
||||
*/
|
||||
public List<MaterialDto> queryMaterialListByParam(String precMaterialName, String vagueMaterialName, String vagueModel) {
|
||||
return quoteMapper.queryMaterialListByParam(precMaterialName, vagueMaterialName, vagueModel);
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function queryMaterialListByParam(query) {
|
||||
return request({
|
||||
url: '/quote/materialList',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
|
@ -7,220 +7,195 @@
|
|||
<template slot="title">
|
||||
<div>
|
||||
<el-button style="margin-left: 20px" size="small" type="primary" >财务费用明细</el-button>
|
||||
<el-button style="margin-left: 50px" @click.native.stop.prevent="restoreDefaults" size="small" type="primary" >恢复默认</el-button>
|
||||
<el-button style="margin-left: 50px" size="small" type="primary" >恢复默认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div class="form-box gray-background" style="margin-top: 5px; padding-top: 5px">
|
||||
<el-form label-width="150px" :model="formLabelAlign" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.officeExpense.fieldStatus }">
|
||||
<el-form-item label="办公费" title="办公费" prop="officeExpense.value">
|
||||
<el-input v-model="formLabelAlign.officeExpense.value" placeholder="办公费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'officeExpense')">
|
||||
<el-col :span="6" >
|
||||
<el-form-item label="办公费" title="办公费" prop="officeExpense">
|
||||
<el-input v-model="formLabelAlign.officeExpense" placeholder="办公费" >
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.travelExpense.fieldStatus }">
|
||||
<el-form-item label="差旅费" title="差旅费" prop="travelExpense.value">
|
||||
<el-input v-model="formLabelAlign.travelExpense.value" placeholder="差旅费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'travelExpense')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="差旅费" title="差旅费" prop="travelExpense">
|
||||
<el-input v-model="formLabelAlign.travelExpense" placeholder="差旅费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.salaryInsur.fieldStatus }">
|
||||
<el-form-item label="工资及福利保险" title="工资及福利保险" prop="salaryInsur.value">
|
||||
<el-input v-model="formLabelAlign.salaryInsur.value" placeholder="工资及福利保险"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'salaryInsur')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="工资及福利保险" title="工资及福利保险" prop="salaryInsur">
|
||||
<el-input v-model="formLabelAlign.salaryInsur" placeholder="工资及福利保险">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.otherMgmtExpense.fieldStatus }">
|
||||
<el-form-item label="其他管理费" title="其他管理费" prop="otherMgmtExpense.value">
|
||||
<el-input v-model="formLabelAlign.otherMgmtExpense.value" placeholder="其他管理费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'otherMgmtExpense')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="其他管理费" title="其他管理费" prop="otherMgmtExpense">
|
||||
<el-input v-model="formLabelAlign.otherMgmtExpense" placeholder="其他管理费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.carExpense.fieldStatus }">
|
||||
<el-form-item label="汽车费用" title="汽车费用" prop="carExpense.value">
|
||||
<el-input v-model="formLabelAlign.carExpense.value" placeholder="汽车费用"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'carExpense')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="汽车费用" title="汽车费用" prop="carExpense">
|
||||
<el-input v-model="formLabelAlign.carExpense" placeholder="汽车费用">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col >
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.mgmtBizEntFee.fieldStatus }">
|
||||
<el-form-item label="管理-业务招待费" title="管理-业务招待费" prop="mgmtBizEntFee.value">
|
||||
<el-input v-model="formLabelAlign.mgmtBizEntFee.value" placeholder="管理-业务招待费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'mgmtBizEntFee')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="管理-业务招待费" title="管理-业务招待费" prop="mgmtBizEntFee">
|
||||
<el-input v-model="formLabelAlign.mgmtBizEntFee" placeholder="管理-业务招待费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.mgmtDeprecExpense.fieldStatus }">
|
||||
<el-form-item label="管理-折旧费" title="管理-折旧费" prop="mgmtDeprecExpense.value"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'mgmtDeprecExpense')">
|
||||
<el-input v-model="formLabelAlign.mgmtDeprecExpense.value" placeholder="管理-折旧费">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="管理-折旧费" title="管理-折旧费" prop="mgmtDeprecExpense">
|
||||
<el-input v-model="formLabelAlign.mgmtDeprecExpense" placeholder="管理-折旧费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.consultAuditFee.fieldStatus }">
|
||||
<el-form-item label="咨询与审计费" title="咨询与审计费" prop="consultAuditFee.value"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'consultAuditFee')">
|
||||
<el-input v-model="formLabelAlign.consultAuditFee.value" placeholder="咨询与审计费">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="咨询与审计费" title="咨询与审计费" prop="consultAuditFee">
|
||||
<el-input v-model="formLabelAlign.consultAuditFee" placeholder="咨询与审计费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.tenderCost.fieldStatus }">
|
||||
<el-form-item label="标书费用" title="标书费用" prop="tenderCost.value">
|
||||
<el-input v-model="formLabelAlign.tenderCost.value" placeholder="标书费用"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'tenderCost')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="标书费用" title="标书费用" prop="tenderCost">
|
||||
<el-input v-model="formLabelAlign.tenderCost" placeholder="标书费用">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.rentExpense.fieldStatus }">
|
||||
<el-form-item label="房租费" title="房租费" prop="rentExpense.value">
|
||||
<el-input v-model="formLabelAlign.rentExpense.value" placeholder="房租费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'rentExpense')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="房租费" title="房租费" prop="rentExpense">
|
||||
<el-input v-model="formLabelAlign.rentExpense" placeholder="房租费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.salary.fieldStatus }">
|
||||
<el-form-item label="工资" title="工资" prop="salary.value">
|
||||
<el-input v-model="formLabelAlign.salary.value" placeholder="工资"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'salary')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="工资" title="工资" prop="salary">
|
||||
<el-input v-model="formLabelAlign.salary" placeholder="工资">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.inspectFee.fieldStatus }">
|
||||
<el-form-item label="检验检查费" prop="inspectFee.value">
|
||||
<el-input v-model="formLabelAlign.inspectFee.value" placeholder="检验检查费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'inspectFee')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检验检查费" prop="inspectFee">
|
||||
<el-input v-model="formLabelAlign.inspectFee" placeholder="检验检查费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.transTravelExpense.fieldStatus }">
|
||||
<el-form-item label="销售-交通与差旅费" title="交通与差旅费" prop="transTravelExpense.value">
|
||||
<el-input v-model="formLabelAlign.transTravelExpense.value" placeholder="交通与差旅费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'transTravelExpense')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="销售-交通与差旅费" title="交通与差旅费" prop="transTravelExpense">
|
||||
<el-input v-model="formLabelAlign.transTravelExpense" placeholder="交通与差旅费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.otherSalesExpense.fieldStatus }">
|
||||
<el-form-item label="其他销售费" title="其他销售费" prop="otherSalesExpense.value">
|
||||
<el-input v-model="formLabelAlign.otherSalesExpense.value" placeholder="其他销售费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'otherSalesExpense')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="其他销售费" title="其他销售费" prop="otherSalesExpense">
|
||||
<el-input v-model="formLabelAlign.otherSalesExpense" placeholder="其他销售费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.biddingCost.fieldStatus }">
|
||||
<el-form-item label="投标费用" title="投标费用" prop="biddingCost.value">
|
||||
<el-input v-model="formLabelAlign.biddingCost.value" placeholder="投标费用"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'biddingCost')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="投标费用" title="投标费用" prop="biddingCost">
|
||||
<el-input v-model="formLabelAlign.biddingCost" placeholder="投标费用">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.bizFee.fieldStatus }">
|
||||
<el-form-item label="销售-业务费" title="销售-业务费" prop="bizFee.value">
|
||||
<el-input v-model="formLabelAlign.bizFee.value" placeholder="销售-业务费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'bizFee')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="销售-业务费" title="销售-业务费" prop="bizFee">
|
||||
<el-input v-model="formLabelAlign.bizFee" placeholder="销售-业务费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.salesBizEntFee.fieldStatus }">
|
||||
<el-form-item label="销售-业务招待费" title="销售-业务招待费" prop="salesBizEntFee.value">
|
||||
<el-input v-model="formLabelAlign.salesBizEntFee.value" placeholder="销售-业务招待费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'salesBizEntFee')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="销售-业务招待费" title="销售-业务招待费" prop="salesBizEntFee">
|
||||
<el-input v-model="formLabelAlign.salesBizEntFee" placeholder="销售-业务招待费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.transpHandlingFee.fieldStatus }">
|
||||
<el-form-item label="运输装卸费" title="运输装卸费" prop="transpHandlingFee.value">
|
||||
<el-input v-model="formLabelAlign.transpHandlingFee.value" placeholder="运输装卸费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'transpHandlingFee')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="运输装卸费" title="运输装卸费" prop="transpHandlingFee">
|
||||
<el-input v-model="formLabelAlign.transpHandlingFee" placeholder="运输装卸费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.manufDeprecExpense.fieldStatus }">
|
||||
<el-form-item label="制造-折旧费" title="制造-折旧费" prop="manufDeprecExpense.value">
|
||||
<el-input v-model="formLabelAlign.manufDeprecExpense.value" placeholder="制造-折旧费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'manufDeprecExpense')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="制造-折旧费" title="制造-折旧费" prop="manufDeprecExpense">
|
||||
<el-input v-model="formLabelAlign.manufDeprecExpense" placeholder="制造-折旧费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.interestExpense.fieldStatus }">
|
||||
<el-form-item label="利息支出" title="利息支出" prop="interestExpense.value">
|
||||
<el-input v-model="formLabelAlign.interestExpense.value" placeholder="利息支出"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'interestExpense')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="利息支出" title="利息支出" prop="interestExpense">
|
||||
<el-input v-model="formLabelAlign.interestExpense" placeholder="利息支出">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.handlingFee.fieldStatus }">
|
||||
<el-form-item label="手续费" title="手续费" prop="handlingFee.value">
|
||||
<el-input v-model="formLabelAlign.handlingFee.value" placeholder="手续费"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'handlingFee')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="手续费" title="手续费" prop="handlingFee">
|
||||
<el-input v-model="formLabelAlign.handlingFee" placeholder="手续费">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.discInterest.fieldStatus }">
|
||||
<el-form-item label="贴现利息" title="贴现利息" prop="discInterest.value">
|
||||
<el-input v-model="formLabelAlign.discInterest.value" placeholder="贴现利息"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'discInterest')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="贴现利息" title="贴现利息" prop="discInterest">
|
||||
<el-input v-model="formLabelAlign.discInterest" placeholder="贴现利息">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.otherFinExpenses.fieldStatus }">
|
||||
<el-form-item label="财务-其他费用" title="财务-其他费用" prop="otherFinExpenses.value">
|
||||
<el-input v-model="formLabelAlign.otherFinExpenses.value" placeholder="财务-其他费用"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'otherFinExpenses')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="财务-其他费用" title="财务-其他费用" prop="otherFinExpenses">
|
||||
<el-input v-model="formLabelAlign.otherFinExpenses" placeholder="财务-其他费用">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.invOpCost.fieldStatus }">
|
||||
<el-form-item label="存货机会成本" title="存货机会成本" prop="invOpCost.value">
|
||||
<el-input v-model="formLabelAlign.invOpCost.value" placeholder="存货机会成本"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'invOpCost')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="存货机会成本" title="存货机会成本" prop="invOpCost">
|
||||
<el-input v-model="formLabelAlign.invOpCost" placeholder="存货机会成本">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6" :class="{ 'changed-field': formLabelAlign.tax.fieldStatus }">
|
||||
<el-form-item label="税金" title="税金" prop="tax.value">
|
||||
<el-input v-model="formLabelAlign.tax.value" placeholder="税金"
|
||||
@blur="validateAndSetDefault(formLabelAlign, 'tax')">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="税金" title="税金" prop="tax">
|
||||
<el-input v-model="formLabelAlign.tax" placeholder="税金">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
@ -273,247 +248,14 @@
|
|||
</div>
|
||||
<!-- 添加物料和计算数据的按钮div -->
|
||||
<div class="button-box">
|
||||
<el-button type="text" @click="addMaterial">添加物料</el-button>
|
||||
<el-button type="text" >添加物料</el-button>
|
||||
<el-button type="text" >计算数据</el-button>
|
||||
</div>
|
||||
<!-- 物料表格控件 -->
|
||||
<div class="table-box">
|
||||
<el-table
|
||||
:data="materialData"
|
||||
border
|
||||
:cell-style="cellStyle"
|
||||
:header-cell-style="{ background: '#eef1f6', color: '#606266', 'text-align': 'center' }">
|
||||
<el-table-column
|
||||
fixed
|
||||
label="编号"
|
||||
type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="prodCategory"
|
||||
label="产品大类">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="120"
|
||||
prop="model"
|
||||
label="型号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="specification"
|
||||
label="规格">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="voltLevel"
|
||||
label="电压等级">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="measureUnit"
|
||||
label="单位">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="matCostPrice"
|
||||
label="材料成本价格(¥)">
|
||||
<template slot-scope="scope">
|
||||
{{ parseFloat(scope.row.matCostPrice).toFixed(2)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="redBookPrice"
|
||||
label="红本价格(¥)">
|
||||
<template slot-scope="scope">
|
||||
{{ parseFloat(scope.row.redBookPrice).toFixed(2)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="redBookCost"
|
||||
label="红本成本(¥)">
|
||||
<template slot-scope="scope">
|
||||
{{ parseFloat(scope.row.redBookCost).toFixed(2)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="rbFacPrice"
|
||||
label="红本厂价(¥)">
|
||||
<template slot-scope="scope">
|
||||
{{ parseFloat(scope.row.rbFacPrice).toFixed(2)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="number"
|
||||
label="数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.number" @blur="validateNumber(scope.row)">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="varRatio"
|
||||
label="差异比率">
|
||||
<!-- 自定义表头 -->
|
||||
<template slot="header" slot-scope="scope">
|
||||
<div>
|
||||
差异比率
|
||||
<el-tooltip effect="dark" content="差异比率 = (红本厂价 - 材料成本价格) / 红本厂价">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 列内容 -->
|
||||
<template slot-scope="scope">
|
||||
<!-- 这里是列的具体内容 -->
|
||||
{{ scope.row.varRatio }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="wdFSurcharge"
|
||||
label="盘具运费">
|
||||
<template slot-scope="scope">
|
||||
{{ (parseFloat(scope.row.wdFSurcharge) * 100).toFixed(2) + '%' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="180"
|
||||
prop="manuCost"
|
||||
label="制造成本">
|
||||
<template slot-scope="scope">
|
||||
{{ (parseFloat(scope.row.manuCost) * 100).toFixed(2) + '%' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
width="120"
|
||||
prop="totalCost"
|
||||
label="总成本(¥)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
width="120"
|
||||
prop="totalFacPrice"
|
||||
label="总厂价(¥)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
width="200"
|
||||
prop="totalVariance"
|
||||
label="(总厂价 - 总成本)/总厂价">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
width="180"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="handleDeleteClick(scope.$index)" style="color: red;" type="text">删除</el-button>
|
||||
<el-button @click="handleDeleteClick(scope.$index)" style="color: red;" type="text">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<!------------------------ dialog控件 ------------------------------------>
|
||||
<el-dialog class="materialDialogTable" :visible.sync="dialogMaterialVisible" width="1100px">
|
||||
<div slot="title" style="margin: 0px">
|
||||
<el-form>
|
||||
<el-form-item >
|
||||
<el-input style="width: 180px; margin-right: 20px" v-model="queryParams.precMaterialName" placeholder="开头物料名称精确查询">
|
||||
</el-input>
|
||||
<el-input style="width: 180px; margin-right: 20px" v-model="queryParams.vagueMaterialName" placeholder="物料名称模糊查询">
|
||||
</el-input>
|
||||
<el-input style="width: 180px; margin-right: 20px" v-model="queryParams.vagueModel" placeholder="规格模糊查询">
|
||||
</el-input>
|
||||
<el-button type="primary" size="small" @click="searchMaterial">查询物料</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row;">
|
||||
<div style="width: 688px">
|
||||
<el-table
|
||||
:data="materialDialogData"
|
||||
@selection-change="handleSelectionChange"
|
||||
ref="materialDialogData"
|
||||
:header-cell-style="{ background: '#eef1f6', color: '#606266', 'text-align': 'center', 'padding': '0px'}"
|
||||
:cell-style="{'text-align': 'center', 'padding': '5px 0px'}"
|
||||
highlight-selection-row
|
||||
:row-key="row => row.uid"
|
||||
:reserve-selection="true"
|
||||
border>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="120"
|
||||
prop="prodCategory"
|
||||
label="产品大类">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="120"
|
||||
prop="model"
|
||||
label="型号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="120"
|
||||
prop="specification"
|
||||
label="规格">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="120"
|
||||
prop="voltLevel"
|
||||
label="电压">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="100"
|
||||
prop="measureUnit"
|
||||
label="单位">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="flex-grow: 1; padding-left: 20px;">
|
||||
<div
|
||||
v-for="(selectedItem, index) in selectedMaterialItems"
|
||||
:key="index"
|
||||
class="selected-item"
|
||||
>
|
||||
{{ selectedItem.model }} , {{ selectedItem.specification }} , {{ selectedItem.voltLevel }}
|
||||
<el-button @click="removeSelectedItem(selectedItem)" type="text" class="remove-btn">✖</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="searchMaterial"
|
||||
/>
|
||||
<div style="text-align: center; padding-top: 20px">
|
||||
<el-button-group>
|
||||
<el-button type="primary" size="small" style="margin-right: 80px" >确认</el-button>
|
||||
<el-button type="warning" size="small" >取消</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {queryMaterialListByParam } from "@/api/quote/quote";
|
||||
const commonRule = [
|
||||
{ required: true, message: '不能为空值,可填0', trigger: 'blur' },
|
||||
{ pattern: /^(([1-9]{1}\d{0,9})|(0{1}))(\.\d{1,3})?$/, message: '格式有误,只能为数字格式', trigger: 'blur' }
|
||||
|
@ -524,31 +266,58 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
formLabelAlign: {
|
||||
officeExpense: { value: 0.022, defaultValue: 0.022, fieldStatus: false },
|
||||
travelExpense: { value: 0.011, defaultValue: 0.011, fieldStatus: false },
|
||||
salaryInsur: { value: 0.394, defaultValue: 0.394, fieldStatus: false },
|
||||
otherMgmtExpense: { value: 0.373, defaultValue: 0.373, fieldStatus: false },
|
||||
carExpense: { value: 0.010, defaultValue: 0.010, fieldStatus: false },
|
||||
mgmtBizEntFee: { value: 0.156, defaultValue: 0.156, fieldStatus: false },
|
||||
mgmtDeprecExpense: { value: 0.016, defaultValue: 0.016, fieldStatus: false },
|
||||
consultAuditFee: { value: 0.026, defaultValue: 0.026, fieldStatus: false },
|
||||
tenderCost: { value: 0.023, defaultValue: 0.023, fieldStatus: false },
|
||||
rentExpense: { value: 0.052, defaultValue: 0.052, fieldStatus: false },
|
||||
salary: { value: 0.239, defaultValue: 0.239, fieldStatus: false },
|
||||
inspectFee: { value: 0.016, defaultValue: 0.016, fieldStatus: false },
|
||||
transTravelExpense: { value: 0.020, defaultValue: 0.020, fieldStatus: false },
|
||||
otherSalesExpense: { value: 0.073, defaultValue: 0.073, fieldStatus: false },
|
||||
biddingCost: { value: 0.134, defaultValue: 0.134, fieldStatus: false },
|
||||
bizFee: { value: 1.183, defaultValue: 1.183, fieldStatus: false },
|
||||
salesBizEntFee: { value: 0.098, defaultValue: 0.098, fieldStatus: false },
|
||||
transpHandlingFee: { value: 0.621, defaultValue: 0.621, fieldStatus: false },
|
||||
manufDeprecExpense: { value: 0.217, defaultValue: 0.217, fieldStatus: false },
|
||||
interestExpense: { value: 0.436, defaultValue: 0.436, fieldStatus: false },
|
||||
handlingFee: { value: 0.108, defaultValue: 0.108, fieldStatus: false },
|
||||
discInterest: { value: 0.363, defaultValue: 0.363, fieldStatus: false },
|
||||
otherFinExpenses: { value: 0.197, defaultValue: 0.197, fieldStatus: false },
|
||||
invOpCost: { value: 0.031, defaultValue: 0.031, fieldStatus: false },
|
||||
tax: { value: 1.5, defaultValue: 1.5, fieldStatus: false }, //税金
|
||||
officeExpense: 0.022,
|
||||
travelExpense: 0.011,
|
||||
salaryInsur: 0.394,
|
||||
otherMgmtExpense: 0.373,
|
||||
carExpense: 0.010,
|
||||
mgmtBizEntFee:0.156, //管理-业务招待费
|
||||
mgmtDeprecExpense: 0.016, //管理-折旧费
|
||||
consultAuditFee: 0.026, //咨询审计费
|
||||
tenderCost: 0.023, //标书费用
|
||||
rentExpense: 0.052, //房租费
|
||||
salary: 0.239, //工资
|
||||
inspectFee: 0.016, //检验检测费
|
||||
transTravelExpense: 0.020, //交通与差旅费
|
||||
otherSalesExpense: 0.073, //其他销售费
|
||||
biddingCost: 0.134, //投标费用
|
||||
bizFee: 1.183, //销售-业务费
|
||||
salesBizEntFee: 0.098, //销售-业务招待费
|
||||
transpHandlingFee: 0.621, //运输装卸费
|
||||
manufDeprecExpense: 0.217, //制造-折旧费
|
||||
interestExpense: 0.436, //利息支出
|
||||
handlingFee: 0.108, //手续费
|
||||
discInterest: 0.363, //贴现利息
|
||||
otherFinExpenses: 0.197, //财务-其他费用
|
||||
invOpCost: 0.031, //存货机会成本
|
||||
tax: 1.5, //税金
|
||||
},
|
||||
formLabelAlignDefault: {
|
||||
officeExpense: 0.022,
|
||||
travelExpense: 0.011,
|
||||
salaryInsur: 0.394,
|
||||
otherMgmtExpense: 0.373,
|
||||
carExpense: 0.010,
|
||||
mgmtBizEntFee:0.156, //管理-业务招待费
|
||||
mgmtDeprecExpense: 0.016, //管理-折旧费
|
||||
consultAuditFee: 0.026, //咨询审计费
|
||||
tenderCost: 0.023, //标书费用
|
||||
rentExpense: 0.052, //房租费
|
||||
salary: 0.239, //工资
|
||||
inspectFee: 0.016, //检验检测费
|
||||
transTravelExpense: 0.020, //交通与差旅费
|
||||
otherSalesExpense: 0.073, //其他销售费
|
||||
biddingCost: 0.134, //投标费用
|
||||
bizFee: 1.183, //销售-业务费
|
||||
salesBizEntFee: 0.098, //销售-业务招待费
|
||||
transpHandlingFee: 0.621, //运输装卸费
|
||||
manufDeprecExpense: 0.217, //制造-折旧费
|
||||
interestExpense: 0.436, //利息支出
|
||||
handlingFee: 0.108, //手续费
|
||||
discInterest: 0.363, //贴现利息
|
||||
otherFinExpenses: 0.197, //财务-其他费用
|
||||
invOpCost: 0.031, //存货机会成本
|
||||
tax: 1.5, //税金
|
||||
},
|
||||
totalForm: {
|
||||
totalFinExpenses: 0,
|
||||
|
@ -557,50 +326,33 @@ export default {
|
|||
totalDifferenceValue: 0
|
||||
},
|
||||
formRules: {
|
||||
'officeExpense.value': commonRule,
|
||||
'travelExpense.value': commonRule,
|
||||
'salaryInsur.value': commonRule,
|
||||
'otherMgmtExpense.value': commonRule,
|
||||
'carExpense.value': commonRule,
|
||||
'mgmtBizEntFee.value': commonRule,
|
||||
'mgmtDeprecExpense.value': commonRule,
|
||||
'tenderCost.value': commonRule,
|
||||
'rentExpense.value': commonRule,
|
||||
'salary.value': commonRule,
|
||||
'inspectFee.value': commonRule,
|
||||
'transTravelExpense.value': commonRule,
|
||||
'otherSalesExpense.value': commonRule,
|
||||
'biddingCost.value': commonRule,
|
||||
'bizFee.value': commonRule,
|
||||
'consultAuditFee.value': commonRule,
|
||||
'transpHandlingFee.value': commonRule,
|
||||
'manufDeprecExpense.value': commonRule,
|
||||
'interestExpense.value': commonRule,
|
||||
'handlingFee.value': commonRule,
|
||||
'discInterest.value': commonRule,
|
||||
'otherFinExpenses.value': commonRule,
|
||||
'invOpCost.value': commonRule,
|
||||
'tax.value': commonRule,
|
||||
'salesBizEntFee.value': commonRule
|
||||
officeExpense: commonRule,
|
||||
travelExpense: commonRule,
|
||||
salaryInsur: commonRule,
|
||||
otherMgmtExpense: commonRule,
|
||||
carExpense: commonRule,
|
||||
mgmtBizEntFee: commonRule,
|
||||
mgmtDeprecExpense: commonRule,
|
||||
tenderCost: commonRule,
|
||||
rentExpense: commonRule,
|
||||
salary: commonRule,
|
||||
inspectFee: commonRule,
|
||||
transTravelExpense: commonRule,
|
||||
otherSalesExpense: commonRule,
|
||||
biddingCost: commonRule,
|
||||
bizFee: commonRule,
|
||||
consultAuditFee: commonRule,
|
||||
transpHandlingFee: commonRule,
|
||||
manufDeprecExpense: commonRule,
|
||||
interestExpense: commonRule,
|
||||
handlingFee: commonRule,
|
||||
discInterest: commonRule,
|
||||
otherFinExpenses: commonRule,
|
||||
invOpCost: commonRule,
|
||||
tax: commonRule,
|
||||
salesBizEntFee: commonRule
|
||||
// Add similar rules for other form fields
|
||||
},
|
||||
materialData: [
|
||||
|
||||
],
|
||||
dialogMaterialVisible: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
precMaterialName: '',
|
||||
vagueMaterialName: '',
|
||||
vagueModel: '',
|
||||
},
|
||||
materialDialogData: [
|
||||
|
||||
],
|
||||
selectedMaterialItems: [], // 选中的数据
|
||||
savedSelectedMaterials: [], // 保存选中的数据
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -617,94 +369,15 @@ export default {
|
|||
async init () {
|
||||
|
||||
},
|
||||
/**--------------输入值改变则底色发生变化------------**/
|
||||
validateAndSetDefault(formLabelAlign, field) {
|
||||
if (formLabelAlign[field].value !== formLabelAlign[field].defaultValue) {
|
||||
this.$set(formLabelAlign, field, {
|
||||
...formLabelAlign[field],
|
||||
fieldStatus: true
|
||||
});
|
||||
}
|
||||
},
|
||||
/**-----------恢复默认------------**/
|
||||
restoreDefaults() {
|
||||
for (const key in this.formLabelAlign) {
|
||||
if (this.formLabelAlign.hasOwnProperty(key)) {
|
||||
// 将value恢复为defaultValue
|
||||
this.$set(this.formLabelAlign, key, {
|
||||
value: this.formLabelAlign[key].defaultValue,
|
||||
defaultValue: this.formLabelAlign[key].defaultValue,
|
||||
fieldStatus: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
/**-------物料表格的cell样式----------**/
|
||||
cellStyle({row, column, rowIndex, columnIndex}) {
|
||||
if(columnIndex === 0) {
|
||||
return 'color : black; text-align : center; background : #E0E0E0; padding: 0px';
|
||||
} else if (columnIndex === 6 || columnIndex === 9) {
|
||||
return 'text-align : center; background : #F5F5F5; padding: 0px';
|
||||
/**--------------表单验证函数------------**/
|
||||
validatePercentage(rule, value, callback) {
|
||||
const numValue = parseFloat(value);
|
||||
if (isNaN(numValue) || numValue < 0 || numValue > 100) {
|
||||
callback(new Error('Please enter a number between 0 and 100'));
|
||||
} else {
|
||||
return ' text-align : center; padding: 0px';
|
||||
callback();
|
||||
}
|
||||
},
|
||||
/**-------物料表格的删除操作----------**/
|
||||
handleDeleteClick(index){
|
||||
this.materialData.splice(index, 1)
|
||||
},
|
||||
/**--------添加物料,打开物料dialog框---------**/
|
||||
addMaterial(){
|
||||
this.dialogMaterialVisible = true;
|
||||
},
|
||||
/**--------查询物料---------**/
|
||||
searchMaterial() {
|
||||
queryMaterialListByParam(this.queryParams).then(response => {
|
||||
this.materialDialogData = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
selection.forEach(item => {
|
||||
// 判断是否已经存在于已选列表中,避免重复添加
|
||||
if (!this.selectedMaterialItems.some(selectedItem => selectedItem.uid === item.uid)) {
|
||||
this.selectedMaterialItems.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
removeSelectedItem(selectedItem) {
|
||||
// 判断当前数据是否被选择
|
||||
const isSelected = this.$refs.materialTable.selection.includes(selectedItem);
|
||||
|
||||
// 从已选列表中移除该项
|
||||
const index = this.selectedMaterialItems.findIndex(item => item.uid === selectedItem.uid);
|
||||
if (index !== -1) {
|
||||
this.selectedMaterialItems.splice(index, 1);
|
||||
}
|
||||
|
||||
// 如果当前数据被选择,则取消 el-table 中该项的选择状态
|
||||
if (isSelected) {
|
||||
this.$refs.materialTable.toggleRowSelection(selectedItem, false);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
addMaterialToTable() {
|
||||
// 将选中的物料信息添加到表格中
|
||||
this.materialData = this.materialData.concat(this.selectedMaterialItems);
|
||||
console.log(this.materialData)
|
||||
// 清空选中的物料信息
|
||||
this.selectedMaterialItems = [];
|
||||
this.$refs.materialTable.clearSelection();
|
||||
this.dialogMaterialVisible = false;
|
||||
|
||||
},
|
||||
|
||||
closeMaterialDialog() {
|
||||
this.dialogMaterialVisible = false;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -746,15 +419,4 @@ export default {
|
|||
backdrop-filter: blur(10px); /* 调整模糊度 */
|
||||
-webkit-backdrop-filter: blur(10px); /* 兼容性处理,适用于一些WebKit浏览器 */
|
||||
}
|
||||
|
||||
.changed-field {
|
||||
background-color: #ffe6e6; /* 更改后的背景颜色 */
|
||||
}
|
||||
|
||||
.materialDialogTable .el-dialog__header{
|
||||
padding: 20px 20px 0px !important;
|
||||
}
|
||||
.materialDialogTable .el-dialog__body{
|
||||
padding: 0px 20px !important;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue