202506061732
This commit is contained in:
parent
5b06f9755e
commit
fceb5fd135
|
|
@ -75,13 +75,32 @@ public class QuoteCraftController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:ServiceGoods:query')")
|
||||
@PostMapping(value = "/selectQuoteTypeList")
|
||||
public AjaxResult selectQuoteTypeList()
|
||||
public AjaxResult selectQuoteTypeList(@RequestBody List<Long> ids)
|
||||
{
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return success(new ArrayList<>());
|
||||
}
|
||||
|
||||
QuoteType quoteType = new QuoteType();
|
||||
QuoteType query = new QuoteType();
|
||||
query.setStatus(1L); // 只获取启用状态的数据
|
||||
List<QuoteType> allTypes = quoteTypeService.selectQuoteTypeList(query);
|
||||
|
||||
List<QuoteType> quoteTypeList = quoteTypeService.selectQuoteTypeList(quoteType);
|
||||
return success(quoteType);
|
||||
// 根据服务项目ID过滤工艺分类
|
||||
List<QuoteType> filteredTypes = allTypes.stream()
|
||||
.filter(type -> {
|
||||
if (type.getGoodId() != null) {
|
||||
try {
|
||||
List<String> typeGoodIds = JSON.parseArray(type.getGoodId(), String.class);
|
||||
return typeGoodIds.stream().anyMatch(goodId -> ids.contains(Long.parseLong(goodId)));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return success(filteredTypes);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -143,14 +162,14 @@ public class QuoteCraftController extends BaseController
|
|||
if (quoteCraft.getTypeId()!=null) {
|
||||
String strtype = quoteCraft.getTypeId();
|
||||
List<String> strtypeList = JSON.parseArray(strtype, String.class);
|
||||
List<Integer> intstrtypeList = strtypeList.stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
quoteCraft.setTypeintids(intstrtypeList);
|
||||
List<Long> longTypeList = strtypeList.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
quoteCraft.setTypeintids(longTypeList);
|
||||
}
|
||||
if (quoteCraft.getGoodId()!=null){
|
||||
String str = quoteCraft.getGoodId();
|
||||
List<String> stringList = JSON.parseArray(str, String.class);
|
||||
List<Integer> intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
quoteCraft.setGoodsintids(intList);
|
||||
List<Long> longList = stringList.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
quoteCraft.setGoodsintids(longList);
|
||||
}
|
||||
}
|
||||
return success(quoteCraft);
|
||||
|
|
@ -164,14 +183,21 @@ public class QuoteCraftController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QuoteCraft quoteCraft)
|
||||
{
|
||||
if(quoteCraft.getGoodsintids().size()>0){
|
||||
List<Integer> intList =quoteCraft.getGoodsintids();
|
||||
if(quoteCraft.getGoodsintids() != null && quoteCraft.getGoodsintids().size()>0){
|
||||
List<Long> longList = quoteCraft.getGoodsintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteCraft.setGoodId(json.replaceAll("\",\"", "\", \""));
|
||||
//String withSpace = compact.replaceAll("\",\"", "\", \"");
|
||||
}
|
||||
if(quoteCraft.getTypeintids() != null && quoteCraft.getTypeintids().size()>0){
|
||||
List<Long> longList = quoteCraft.getTypeintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteCraft.setTypeId(json.replaceAll("\",\"", "\", \""));
|
||||
}
|
||||
return toAjax(quoteCraftService.insertQuoteCraft(quoteCraft));
|
||||
}
|
||||
|
|
@ -184,14 +210,21 @@ public class QuoteCraftController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QuoteCraft quoteCraft)
|
||||
{
|
||||
if(quoteCraft.getGoodsintids().size()>0){
|
||||
List<Integer> intList =quoteCraft.getGoodsintids();
|
||||
if(quoteCraft.getGoodsintids() != null && quoteCraft.getGoodsintids().size()>0){
|
||||
List<Long> longList = quoteCraft.getGoodsintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteCraft.setGoodId(json.replaceAll("\",\"", "\", \""));
|
||||
//String withSpace = compact.replaceAll("\",\"", "\", \"");
|
||||
}
|
||||
if(quoteCraft.getTypeintids() != null && quoteCraft.getTypeintids().size()>0){
|
||||
List<Long> longList = quoteCraft.getTypeintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteCraft.setTypeId(json.replaceAll("\",\"", "\", \""));
|
||||
}
|
||||
return toAjax(quoteCraftService.updateQuoteCraft(quoteCraft));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,11 +106,19 @@ public class QuoteMaterialController extends BaseController
|
|||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
QuoteMaterial quoteMaterial=quoteMaterialService.selectQuoteMaterialById(id);
|
||||
if (quoteMaterial.getGoodId()!=null){
|
||||
if (quoteMaterial != null) {
|
||||
if (quoteMaterial.getGoodId() != null) {
|
||||
String str = quoteMaterial.getGoodId();
|
||||
List<String> stringList = JSON.parseArray(str, String.class);
|
||||
List<Integer> intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
quoteMaterial.setGoodsintids(intList);
|
||||
List<Long> longList = stringList.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
quoteMaterial.setGoodsintids(longList);
|
||||
}
|
||||
if (quoteMaterial.getTypeId() != null) {
|
||||
String typeStr = quoteMaterial.getTypeId();
|
||||
List<String> typeStringList = JSON.parseArray(typeStr, String.class);
|
||||
List<Long> typeLongList = typeStringList.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
quoteMaterial.setTypeintids(typeLongList);
|
||||
}
|
||||
}
|
||||
return success(quoteMaterial);
|
||||
}
|
||||
|
|
@ -123,14 +131,17 @@ public class QuoteMaterialController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QuoteMaterial quoteMaterial)
|
||||
{
|
||||
if(quoteMaterial.getGoodsintids().size()>0){
|
||||
List<Integer> intList =quoteMaterial.getGoodsintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
if (quoteMaterial.getGoodsintids() != null && quoteMaterial.getGoodsintids().size() > 0) {
|
||||
List<Long> longList = quoteMaterial.getGoodsintids();
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteMaterial.setGoodId(json.replaceAll("\",\"", "\", \""));
|
||||
//String withSpace = compact.replaceAll("\",\"", "\", \"");
|
||||
}
|
||||
if (quoteMaterial.getTypeintids() != null && quoteMaterial.getTypeintids().size() > 0) {
|
||||
List<Long> longList = quoteMaterial.getTypeintids();
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteMaterial.setTypeId(json.replaceAll("\",\"", "\", \""));
|
||||
}
|
||||
return toAjax(quoteMaterialService.insertQuoteMaterial(quoteMaterial));
|
||||
}
|
||||
|
|
@ -143,17 +154,17 @@ public class QuoteMaterialController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QuoteMaterial quoteMaterial)
|
||||
{
|
||||
if(quoteMaterial.getGoodsintids().size()>0){
|
||||
System.out.println("#########################"+quoteMaterial.getGoodsintids());
|
||||
List<Integer> intList =quoteMaterial.getGoodsintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
if (quoteMaterial.getGoodsintids() != null && quoteMaterial.getGoodsintids().size() > 0) {
|
||||
List<Long> longList = quoteMaterial.getGoodsintids();
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteMaterial.setGoodId(json.replaceAll("\",\"", "\", \""));
|
||||
//String withSpace = compact.replaceAll("\",\"", "\", \"");
|
||||
|
||||
|
||||
}
|
||||
if (quoteMaterial.getTypeintids() != null && quoteMaterial.getTypeintids().size() > 0) {
|
||||
List<Long> longList = quoteMaterial.getTypeintids();
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteMaterial.setTypeId(json.replaceAll("\",\"", "\", \""));
|
||||
}
|
||||
return toAjax(quoteMaterialService.updateQuoteMaterial(quoteMaterial));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,19 @@ public class QuoteMaterialTypeController extends BaseController
|
|||
util.exportExcel(response, list, "项目报价--物料分类数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目报价--物料分类数据列表(不分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:QuoteMaterialType:query')")
|
||||
@GetMapping(value = "/dataList")
|
||||
public AjaxResult dataList()
|
||||
{
|
||||
QuoteMaterialType query = new QuoteMaterialType();
|
||||
query.setStatus(1L); // 只获取启用状态的数据
|
||||
List<QuoteMaterialType> list = quoteMaterialTypeService.selectQuoteMaterialTypeList(query);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目报价--物料分类详细信息
|
||||
*/
|
||||
|
|
@ -86,8 +99,8 @@ public class QuoteMaterialTypeController extends BaseController
|
|||
if (quoteMaterialType.getGoodId()!=null){
|
||||
String str = quoteMaterialType.getGoodId();
|
||||
List<String> stringList = JSON.parseArray(str, String.class);
|
||||
List<Integer> intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
quoteMaterialType.setGoodsintids(intList);
|
||||
List<Long> longList = stringList.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
quoteMaterialType.setGoodsintids(longList);
|
||||
}
|
||||
|
||||
return success(quoteMaterialType);
|
||||
|
|
@ -101,14 +114,13 @@ public class QuoteMaterialTypeController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QuoteMaterialType quoteMaterialType)
|
||||
{
|
||||
if(quoteMaterialType.getGoodsintids().size()>0){
|
||||
List<Integer> intList =quoteMaterialType.getGoodsintids();
|
||||
if(quoteMaterialType.getGoodsintids() != null && quoteMaterialType.getGoodsintids().size()>0){
|
||||
List<Long> longList = quoteMaterialType.getGoodsintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteMaterialType.setGoodId(json.replaceAll("\",\"", "\", \""));
|
||||
//String withSpace = compact.replaceAll("\",\"", "\", \"");
|
||||
}
|
||||
return toAjax(quoteMaterialTypeService.insertQuoteMaterialType(quoteMaterialType));
|
||||
}
|
||||
|
|
@ -121,17 +133,15 @@ public class QuoteMaterialTypeController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QuoteMaterialType quoteMaterialType)
|
||||
{
|
||||
if(quoteMaterialType.getGoodsintids().size()>0){
|
||||
if(quoteMaterialType.getGoodsintids() != null && quoteMaterialType.getGoodsintids().size()>0){
|
||||
System.out.println("#########################"+quoteMaterialType.getGoodsintids());
|
||||
List<Integer> intList =quoteMaterialType.getGoodsintids();
|
||||
List<Long> longList = quoteMaterialType.getGoodsintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteMaterialType.setGoodId(json.replaceAll("\",\"", "\", \""));
|
||||
//String withSpace = compact.replaceAll("\",\"", "\", \"");
|
||||
System.out.println("#########################"+json.replaceAll("\",\"", "\", \""));
|
||||
|
||||
}
|
||||
return toAjax(quoteMaterialTypeService.updateQuoteMaterialType(quoteMaterialType));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,6 +129,19 @@ public class QuoteTypeController extends BaseController
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取项目报价--工艺分类数据列表(不分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:QuoteType:query')")
|
||||
@GetMapping(value = "/dataList")
|
||||
public AjaxResult dataList()
|
||||
{
|
||||
QuoteType query = new QuoteType();
|
||||
query.setStatus(1L); // 只获取启用状态的数据
|
||||
List<QuoteType> list = quoteTypeService.selectQuoteTypeList(query);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目报价--工艺分类详细信息
|
||||
*/
|
||||
|
|
@ -141,8 +154,8 @@ public class QuoteTypeController extends BaseController
|
|||
if (quoteType.getGoodId()!=null){
|
||||
String str = quoteType.getGoodId();
|
||||
List<String> stringList = JSON.parseArray(str, String.class);
|
||||
List<Integer> intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
quoteType.setGoodsintids(intList);
|
||||
List<Long> longList = stringList.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
quoteType.setGoodsintids(longList);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -160,14 +173,13 @@ public class QuoteTypeController extends BaseController
|
|||
public AjaxResult add(@RequestBody QuoteType quoteType)
|
||||
{
|
||||
|
||||
if(quoteType.getGoodsintids().size()>0){
|
||||
List<Integer> intList =quoteType.getGoodsintids();
|
||||
if(quoteType.getGoodsintids() != null && quoteType.getGoodsintids().size()>0){
|
||||
List<Long> longList = quoteType.getGoodsintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteType.setGoodId(json.replaceAll("\",\"", "\", \""));
|
||||
//String withSpace = compact.replaceAll("\",\"", "\", \"");
|
||||
}
|
||||
return toAjax(quoteTypeService.insertQuoteType(quoteType));
|
||||
}
|
||||
|
|
@ -180,18 +192,13 @@ public class QuoteTypeController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QuoteType quoteType)
|
||||
{
|
||||
|
||||
if(quoteType.getGoodsintids().size()>0){
|
||||
System.out.println("#########################"+quoteType.getGoodsintids());
|
||||
List<Integer> intList =quoteType.getGoodsintids();
|
||||
if(quoteType.getGoodsintids() != null && quoteType.getGoodsintids().size()>0){
|
||||
List<Long> longList = quoteType.getGoodsintids();
|
||||
// 先转成字符串List
|
||||
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
List<String> strList = longList.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
// 再转成json字符串
|
||||
String json = JSON.toJSONString(strList);
|
||||
quoteType.setGoodId(json.replaceAll("\",\"", "\", \""));
|
||||
//String withSpace = compact.replaceAll("\",\"", "\", \"");
|
||||
System.out.println("#########################"+json.replaceAll("\",\"", "\", \""));
|
||||
|
||||
}
|
||||
return toAjax(quoteTypeService.updateQuoteType(quoteType));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ public class QuoteCraft extends BaseEntity
|
|||
@Excel(name = "服务名称")
|
||||
private String ServiceName;
|
||||
|
||||
private List<Integer> goodsintids;
|
||||
private List<Long> goodsintids;
|
||||
|
||||
private List<Integer> typeintids;
|
||||
private List<Long> typeintids;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
|
|
@ -146,19 +146,19 @@ public class QuoteCraft extends BaseEntity
|
|||
ServiceName = serviceName;
|
||||
}
|
||||
|
||||
public List<Integer> getGoodsintids() {
|
||||
public List<Long> getGoodsintids() {
|
||||
return goodsintids;
|
||||
}
|
||||
|
||||
public void setGoodsintids(List<Integer> goodsintids) {
|
||||
public void setGoodsintids(List<Long> goodsintids) {
|
||||
this.goodsintids = goodsintids;
|
||||
}
|
||||
|
||||
public List<Integer> getTypeintids() {
|
||||
public List<Long> getTypeintids() {
|
||||
return typeintids;
|
||||
}
|
||||
|
||||
public void setTypeintids(List<Integer> typeintids) {
|
||||
public void setTypeintids(List<Long> typeintids) {
|
||||
this.typeintids = typeintids;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,9 @@ public class QuoteMaterial extends BaseEntity
|
|||
private Date updatedAt;
|
||||
|
||||
|
||||
private List<Integer> goodsintids;
|
||||
private List<Long> goodsintids;
|
||||
|
||||
private List<Long> typeintids;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
|
|
@ -185,14 +187,22 @@ public class QuoteMaterial extends BaseEntity
|
|||
this.priceMax = priceMax;
|
||||
}
|
||||
|
||||
public List<Integer> getGoodsintids() {
|
||||
public List<Long> getGoodsintids() {
|
||||
return goodsintids;
|
||||
}
|
||||
|
||||
public void setGoodsintids(List<Integer> goodsintids) {
|
||||
public void setGoodsintids(List<Long> goodsintids) {
|
||||
this.goodsintids = goodsintids;
|
||||
}
|
||||
|
||||
public List<Long> getTypeintids() {
|
||||
return typeintids;
|
||||
}
|
||||
|
||||
public void setTypeintids(List<Long> typeintids) {
|
||||
this.typeintids = typeintids;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class QuoteMaterialType extends BaseEntity
|
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date updatedAt;
|
||||
|
||||
private List<Integer> goodsintids;
|
||||
private List<Long> goodsintids;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
|
|
@ -129,11 +129,11 @@ public class QuoteMaterialType extends BaseEntity
|
|||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
public List<Integer> getGoodsintids() {
|
||||
public List<Long> getGoodsintids() {
|
||||
return goodsintids;
|
||||
}
|
||||
|
||||
public void setGoodsintids(List<Integer> goodsintids) {
|
||||
public void setGoodsintids(List<Long> goodsintids) {
|
||||
this.goodsintids = goodsintids;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class QuoteType extends BaseEntity
|
|||
|
||||
private List<String> goodsids;
|
||||
|
||||
private List<Integer> goodsintids;
|
||||
private List<Long> goodsintids;
|
||||
|
||||
|
||||
|
||||
|
|
@ -146,11 +146,11 @@ public class QuoteType extends BaseEntity
|
|||
this.goodsids = goodsids;
|
||||
}
|
||||
|
||||
public List<Integer> getGoodsintids() {
|
||||
public List<Long> getGoodsintids() {
|
||||
return goodsintids;
|
||||
}
|
||||
|
||||
public void setGoodsintids(List<Integer> goodsintids) {
|
||||
public void setGoodsintids(List<Long> goodsintids) {
|
||||
this.goodsintids = goodsintids;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,14 @@ export function getQuoteMaterialType(id) {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取项目报价--物料分类数据列表(不分页)
|
||||
export function getQuoteMaterialTypeDataList() {
|
||||
return request({
|
||||
url: '/system/QuoteMaterialType/dataList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 任务状态修改
|
||||
export function changetypeStatus(id, status) {
|
||||
const data = {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,14 @@ export function getQuoteType(id) {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取项目报价--工艺分类数据列表(不分页)
|
||||
export function getQuoteTypeDataList() {
|
||||
return request({
|
||||
url: '/system/QuoteType/dataList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 任务状态修改
|
||||
export function changetypeStatus(id, status) {
|
||||
const data = {
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="intstrtypeList">
|
||||
<el-select v-model="form.intstrtypeList" multiple filterable placeholder="请选择类型" style="width: 100%">
|
||||
<el-form-item label="类型" prop="typeintids">
|
||||
<el-select v-model="form.typeintids" multiple filterable placeholder="请选择类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="type in typeSelectDataList"
|
||||
:key="type.id"
|
||||
|
|
@ -211,7 +211,7 @@ export default {
|
|||
goodId: undefined,
|
||||
goodsintids: [],
|
||||
typeId: undefined,
|
||||
intstrtypeList: [],
|
||||
typeintids: [],
|
||||
title: undefined,
|
||||
price: 0,
|
||||
unit: undefined,
|
||||
|
|
@ -224,7 +224,7 @@ export default {
|
|||
{ required: true, message: "服务不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
intstrtypeList: [
|
||||
typeintids: [
|
||||
{ required: true, message: "类型不能为空", trigger: "blur" }
|
||||
],
|
||||
title: [
|
||||
|
|
@ -269,7 +269,7 @@ export default {
|
|||
goodId: undefined,
|
||||
goodsintids: [],
|
||||
typeId: undefined,
|
||||
intstrtypeList: [],
|
||||
typeintids: [],
|
||||
title: undefined,
|
||||
price: 0,
|
||||
unit: undefined,
|
||||
|
|
@ -284,8 +284,11 @@ export default {
|
|||
const ids = this.form.goodsintids || [];
|
||||
if (ids.length > 0) {
|
||||
selectQuoteTypeList(ids).then(response => {
|
||||
this.typeSelectDataList = response.data;
|
||||
})
|
||||
this.typeSelectDataList = response.data || [];
|
||||
}).catch(error => {
|
||||
console.error('获取工艺分类失败:', error);
|
||||
this.typeSelectDataList = [];
|
||||
});
|
||||
} else {
|
||||
this.typeSelectDataList = [];
|
||||
}
|
||||
|
|
@ -316,7 +319,7 @@ export default {
|
|||
});
|
||||
},
|
||||
getTypeList() {
|
||||
getGoodsDataList().then(response => {
|
||||
getGoodsDataList(1).then(response => {
|
||||
this.typeDataList = response.data || [];
|
||||
}).catch(() => {
|
||||
this.typeDataList = [];
|
||||
|
|
@ -336,11 +339,16 @@ export default {
|
|||
this.form = {
|
||||
...response.data,
|
||||
goodsintids: response.data.goodsintids || [],
|
||||
intstrtypeList: response.data.intstrtypeList || []
|
||||
typeintids: response.data.typeintids || []
|
||||
};
|
||||
// 如果有服务ID,获取对应的类型列表
|
||||
if (this.form.goodsintids && this.form.goodsintids.length > 0) {
|
||||
this.handelSelectMultiple();
|
||||
selectQuoteTypeList(this.form.goodsintids).then(response => {
|
||||
this.typeSelectDataList = response.data || [];
|
||||
}).catch(error => {
|
||||
console.error('获取工艺分类失败:', error);
|
||||
this.typeSelectDataList = [];
|
||||
});
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.open = true;
|
||||
|
|
|
|||
|
|
@ -154,8 +154,15 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="typeId">
|
||||
<el-input v-model="form.typeId" placeholder="请输入类型" />
|
||||
<el-form-item label="类型" prop="typeintids">
|
||||
<el-select v-model="form.typeintids" multiple filterable placeholder="请选择类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="type in materialTypeList"
|
||||
:key="type.id"
|
||||
:label="type.title"
|
||||
:value="type.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题" />
|
||||
|
|
@ -178,6 +185,7 @@
|
|||
<script>
|
||||
import { listQuoteMaterial, getQuoteMaterial, delQuoteMaterial, addQuoteMaterial, updateQuoteMaterial } from "@/api/system/QuoteMaterial"
|
||||
import { getGoodsDataList } from "@/api/system/QuoteType"
|
||||
import { getQuoteMaterialTypeDataList } from "@/api/system/QuoteMaterialType"
|
||||
export default {
|
||||
name: "QuoteMaterial",
|
||||
data() {
|
||||
|
|
@ -196,6 +204,7 @@ export default {
|
|||
total: 0,
|
||||
|
||||
typeDataList: [],
|
||||
materialTypeList: [],
|
||||
// 项目报价--物料信息表格数据
|
||||
QuoteMaterialList: [],
|
||||
// 弹出层标题
|
||||
|
|
@ -217,13 +226,24 @@ export default {
|
|||
updatedAt: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
id: null,
|
||||
goodId: null,
|
||||
goodsintids: [],
|
||||
typeId: null,
|
||||
typeintids: [],
|
||||
title: null,
|
||||
price: null,
|
||||
unit: null,
|
||||
createdAt: null,
|
||||
updatedAt: null
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
goodsintids: [
|
||||
{ required: true, message: "服务项目不能为空", trigger: "blur" }
|
||||
],
|
||||
typeId: [
|
||||
typeintids: [
|
||||
{ required: true, message: "类型不能为空", trigger: "blur" }
|
||||
],
|
||||
title: [
|
||||
|
|
@ -241,6 +261,7 @@ export default {
|
|||
created() {
|
||||
this.getList();
|
||||
this.getTypeList();
|
||||
this.getMaterialTypeList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询项目报价--物料信息列表 */
|
||||
|
|
@ -262,7 +283,9 @@ export default {
|
|||
this.form = {
|
||||
id: null,
|
||||
goodId: null,
|
||||
goodsintids: [],
|
||||
typeId: null,
|
||||
typeintids: [],
|
||||
title: null,
|
||||
price: null,
|
||||
unit: null,
|
||||
|
|
@ -312,16 +335,25 @@ export default {
|
|||
this.title = "添加项目报价--物料信息"
|
||||
},
|
||||
getTypeList() {
|
||||
getGoodsDataList().then(response => {
|
||||
getGoodsDataList(1).then(response => {
|
||||
this.typeDataList = response.data;
|
||||
})
|
||||
},
|
||||
getMaterialTypeList() {
|
||||
getQuoteMaterialTypeDataList().then(response => {
|
||||
this.materialTypeList = response.data || [];
|
||||
})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getQuoteMaterial(id).then(response => {
|
||||
this.form = response.data
|
||||
this.form = {
|
||||
...response.data,
|
||||
goodsintids: response.data.goodsintids || [],
|
||||
typeintids: response.data.typeintids || []
|
||||
}
|
||||
this.open = true
|
||||
this.title = "修改项目报价--物料信息"
|
||||
})
|
||||
|
|
|
|||
|
|
@ -205,7 +205,16 @@ export default {
|
|||
priceMax: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
id: null,
|
||||
title: null,
|
||||
goodId: null,
|
||||
goodsintids: [],
|
||||
sort: null,
|
||||
status: null,
|
||||
createdAt: null,
|
||||
updatedAt: null
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
title: [
|
||||
|
|
@ -248,6 +257,7 @@ export default {
|
|||
id: null,
|
||||
title: null,
|
||||
goodId: null,
|
||||
goodsintids: [],
|
||||
sort: null,
|
||||
status: null,
|
||||
createdAt: null,
|
||||
|
|
@ -312,13 +322,16 @@ export default {
|
|||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getQuoteMaterialType(id).then(response => {
|
||||
this.form = response.data
|
||||
this.form = {
|
||||
...response.data,
|
||||
goodsintids: response.data.goodsintids || []
|
||||
}
|
||||
this.open = true
|
||||
this.title = "修改项目报价--物料分类"
|
||||
})
|
||||
},
|
||||
getTypeList() {
|
||||
getGoodsDataList().then(response => {
|
||||
getGoodsDataList(1).then(response => {
|
||||
this.typeDataList = response.data;
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -195,7 +195,16 @@ export default {
|
|||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
id: null,
|
||||
title: null,
|
||||
goodId: null,
|
||||
goodsintids: [],
|
||||
sort: null,
|
||||
status: null,
|
||||
createdAt: null,
|
||||
updatedAt: null
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
title: [
|
||||
|
|
@ -239,6 +248,7 @@ export default {
|
|||
id: null,
|
||||
title: null,
|
||||
goodId: null,
|
||||
goodsintids: [],
|
||||
sort: null,
|
||||
status: null,
|
||||
createdAt: null,
|
||||
|
|
@ -289,14 +299,10 @@ export default {
|
|||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getQuoteType(id).then(response => {
|
||||
const data = response.data
|
||||
// // 处理 goodId 为多选数组
|
||||
// if (typeof data.goodId === 'string') {
|
||||
// data.goodId = data.goodId.split(',').map(i => i.trim()).filter(i => i)
|
||||
// } else if (!Array.isArray(data.goodId)) {
|
||||
// data.goodId = []
|
||||
// }
|
||||
this.form = data
|
||||
this.form = {
|
||||
...response.data,
|
||||
goodsintids: response.data.goodsintids || []
|
||||
}
|
||||
this.open = true
|
||||
this.title = "修改项目报价--工艺分类"
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue