202505281650

This commit is contained in:
张潘 2025-05-28 16:50:34 +08:00
parent 4af16aaea6
commit cc9963b423
14 changed files with 642 additions and 159 deletions

View File

@ -1,9 +1,15 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.system.domain.QuoteType;
import com.ruoyi.system.domain.ServiceCate;
import com.ruoyi.system.service.IQuoteTypeService;
import com.ruoyi.system.service.IServiceGoodsService; import com.ruoyi.system.service.IServiceGoodsService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -37,7 +43,8 @@ public class QuoteCraftController extends BaseController
@Autowired @Autowired
private IQuoteCraftService quoteCraftService; private IQuoteCraftService quoteCraftService;
@Autowired
private IQuoteTypeService quoteTypeService;
@Autowired @Autowired
private IServiceGoodsService serviceGoodsService; private IServiceGoodsService serviceGoodsService;
@ -62,6 +69,40 @@ public class QuoteCraftController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取工艺分类下拉list用来进行多选
*/
@PreAuthorize("@ss.hasPermi('system:ServiceGoods:query')")
@PostMapping(value = "/selectQuoteTypeList")
public AjaxResult selectQuoteTypeList()
{
QuoteType quoteType = new QuoteType();
List<QuoteType> quoteTypeList = quoteTypeService.selectQuoteTypeList(quoteType);
return success(quoteType);
}
// /**
// * 获取工艺分类下拉list用来进行多选
// */
// @PreAuthorize("@ss.hasPermi('system:ServiceGoods:query')")
// @PostMapping(value = "/selectQuoteTypeList")
// public AjaxResult selectQuoteTypeList(@RequestBody ArrayList<Integer> ids)
// {
// System.out.println("&&&&&&&&&&&&&&&"+ids);
// QuoteType quoteType = new QuoteType();
//// if(ids!=null){
//// List<String> idslist = Arrays.asList(
////
//// quoteType.setGoodsids(idslist);
//// }
// List<QuoteType> quoteTypeList = quoteTypeService.selectQuoteTypeList(quoteType);
// return success(quoteTypeList);
// }
/** /**
* 导出项目报价--服务工艺列表 * 导出项目报价--服务工艺列表
*/ */
@ -82,7 +123,22 @@ public class QuoteCraftController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
return success(quoteCraftService.selectQuoteCraftById(id)); QuoteCraft quoteCraft=quoteCraftService.selectQuoteCraftById(id);
if(quoteCraft!=null){
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);
}
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);
}
}
return success(quoteCraft);
} }
/** /**
@ -93,6 +149,15 @@ public class QuoteCraftController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody QuoteCraft quoteCraft) public AjaxResult add(@RequestBody QuoteCraft quoteCraft)
{ {
if(quoteCraft.getGoodsintids().size()>0){
List<Integer> intList =quoteCraft.getGoodsintids();
// 先转成字符串List
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
// 再转成json字符串
String json = JSON.toJSONString(strList);
quoteCraft.setGoodId(json.replaceAll("\",\"", "\", \""));
//String withSpace = compact.replaceAll("\",\"", "\", \"");
}
return toAjax(quoteCraftService.insertQuoteCraft(quoteCraft)); return toAjax(quoteCraftService.insertQuoteCraft(quoteCraft));
} }
@ -104,6 +169,15 @@ public class QuoteCraftController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody QuoteCraft quoteCraft) public AjaxResult edit(@RequestBody QuoteCraft quoteCraft)
{ {
if(quoteCraft.getGoodsintids().size()>0){
List<Integer> intList =quoteCraft.getGoodsintids();
// 先转成字符串List
List<String> strList = intList.stream().map(String::valueOf).collect(Collectors.toList());
// 再转成json字符串
String json = JSON.toJSONString(strList);
quoteCraft.setGoodId(json.replaceAll("\",\"", "\", \""));
//String withSpace = compact.replaceAll("\",\"", "\", \"");
}
return toAjax(quoteCraftService.updateQuoteCraft(quoteCraft)); return toAjax(quoteCraftService.updateQuoteCraft(quoteCraft));
} }

View File

@ -2,8 +2,10 @@ package com.ruoyi.system.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.system.domain.QuoteType; import com.ruoyi.system.domain.QuoteType;
import com.ruoyi.system.service.IQuoteMaterialTypeService; import com.ruoyi.system.service.IQuoteMaterialTypeService;
import com.ruoyi.system.service.IServiceGoodsService; import com.ruoyi.system.service.IServiceGoodsService;
@ -87,7 +89,14 @@ public class QuoteMaterialController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
return success(quoteMaterialService.selectQuoteMaterialById(id)); QuoteMaterial quoteMaterial=quoteMaterialService.selectQuoteMaterialById(id);
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);
}
return success(quoteMaterial);
} }
/** /**
@ -98,6 +107,15 @@ public class QuoteMaterialController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody QuoteMaterial quoteMaterial) 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字符串
String json = JSON.toJSONString(strList);
quoteMaterial.setGoodId(json.replaceAll("\",\"", "\", \""));
//String withSpace = compact.replaceAll("\",\"", "\", \"");
}
return toAjax(quoteMaterialService.insertQuoteMaterial(quoteMaterial)); return toAjax(quoteMaterialService.insertQuoteMaterial(quoteMaterial));
} }
@ -109,6 +127,18 @@ public class QuoteMaterialController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody QuoteMaterial quoteMaterial) 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字符串
String json = JSON.toJSONString(strList);
quoteMaterial.setGoodId(json.replaceAll("\",\"", "\", \""));
//String withSpace = compact.replaceAll("\",\"", "\", \"");
System.out.println("#########################"+json.replaceAll("\",\"", "\", \""));
}
return toAjax(quoteMaterialService.updateQuoteMaterial(quoteMaterial)); return toAjax(quoteMaterialService.updateQuoteMaterial(quoteMaterial));
} }

View File

@ -2,8 +2,11 @@ package com.ruoyi.system.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.system.domain.QuoteType;
import com.ruoyi.system.service.IServiceGoodsService; import com.ruoyi.system.service.IServiceGoodsService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -79,7 +82,15 @@ public class QuoteMaterialTypeController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
return success(quoteMaterialTypeService.selectQuoteMaterialTypeById(id)); QuoteMaterialType quoteMaterialType =quoteMaterialTypeService.selectQuoteMaterialTypeById(id);
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);
}
return success(quoteMaterialType);
} }
/** /**
@ -90,6 +101,15 @@ public class QuoteMaterialTypeController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody QuoteMaterialType quoteMaterialType) public AjaxResult add(@RequestBody QuoteMaterialType quoteMaterialType)
{ {
if(quoteMaterialType.getGoodsintids().size()>0){
List<Integer> intList =quoteMaterialType.getGoodsintids();
// 先转成字符串List
List<String> strList = intList.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)); return toAjax(quoteMaterialTypeService.insertQuoteMaterialType(quoteMaterialType));
} }
@ -101,6 +121,18 @@ public class QuoteMaterialTypeController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody QuoteMaterialType quoteMaterialType) public AjaxResult edit(@RequestBody QuoteMaterialType quoteMaterialType)
{ {
if(quoteMaterialType.getGoodsintids().size()>0){
System.out.println("#########################"+quoteMaterialType.getGoodsintids());
List<Integer> intList =quoteMaterialType.getGoodsintids();
// 先转成字符串List
List<String> strList = intList.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)); return toAjax(quoteMaterialTypeService.updateQuoteMaterialType(quoteMaterialType));
} }

View File

@ -80,6 +80,8 @@ public class QuoteTypeController extends BaseController
List<QuoteType> list = quoteTypeService.selectQuoteTypeList(quoteType); List<QuoteType> list = quoteTypeService.selectQuoteTypeList(quoteType);
for(QuoteType quoteTypeData:list){ for(QuoteType quoteTypeData:list){
System.out.println("#########################"+quoteTypeData.getGoodId());
System.out.println("#########################"+quoteTypeData.getGoodId().replaceAll("[\\[\\]\"]", "").split(", "));
List<String> idslist = Arrays.asList( List<String> idslist = Arrays.asList(
quoteTypeData.getGoodId().replaceAll("[\\[\\]\"]", "").split(", ")); quoteTypeData.getGoodId().replaceAll("[\\[\\]\"]", "").split(", "));
quoteTypeData.setServiceName(serviceGoodsService.selectTitlesByIds(idslist)); quoteTypeData.setServiceName(serviceGoodsService.selectTitlesByIds(idslist));
@ -135,24 +137,16 @@ public class QuoteTypeController extends BaseController
QuoteType quoteType = quoteTypeService.selectQuoteTypeById(id); QuoteType quoteType = quoteTypeService.selectQuoteTypeById(id);
if (quoteType.getGoodId()!=null){ if (quoteType.getGoodId()!=null){
String str = "[\"45\", \"47\", \"48\", \"49\", \"5\", \"52\"]"; String str = quoteType.getGoodId();
List<String> stringList = JSON.parseArray(str, String.class); List<String> stringList = JSON.parseArray(str, String.class);
List<Integer> intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList()); List<Integer> intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList());
quoteType.setGoodsintids(intList); quoteType.setGoodsintids(intList);
} }
return success(quoteType); return success(quoteType);
} }
// public static void main(String[] args) {
// String str = "[\"45\", \"47\", \"48\", \"49\", \"5\", \"52\"]";
// List<String> stringList = JSON.parseArray(str, String.class);
// List<Integer> intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList());
// System.out.println(intList); // 输出: [45, 47, 48, 49, 5, 52]
// }
/** /**
@ -163,6 +157,16 @@ public class QuoteTypeController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody QuoteType quoteType) public AjaxResult add(@RequestBody QuoteType quoteType)
{ {
if(quoteType.getGoodsintids().size()>0){
List<Integer> intList =quoteType.getGoodsintids();
// 先转成字符串List
List<String> strList = intList.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)); return toAjax(quoteTypeService.insertQuoteType(quoteType));
} }
@ -174,6 +178,19 @@ public class QuoteTypeController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody QuoteType quoteType) public AjaxResult edit(@RequestBody QuoteType quoteType)
{ {
if(quoteType.getGoodsintids().size()>0){
System.out.println("#########################"+quoteType.getGoodsintids());
List<Integer> intList =quoteType.getGoodsintids();
// 先转成字符串List
List<String> strList = intList.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)); return toAjax(quoteTypeService.updateQuoteType(quoteType));
} }
/** /**

View File

@ -2,6 +2,7 @@ package com.ruoyi.system.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -45,6 +46,10 @@ public class QuoteCraft extends BaseEntity
@Excel(name = "服务名称") @Excel(name = "服务名称")
private String ServiceName; private String ServiceName;
private List<Integer> goodsintids;
private List<Integer> typeintids;
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date createdAt; private Date createdAt;
@ -141,6 +146,22 @@ public class QuoteCraft extends BaseEntity
ServiceName = serviceName; ServiceName = serviceName;
} }
public List<Integer> getGoodsintids() {
return goodsintids;
}
public void setGoodsintids(List<Integer> goodsintids) {
this.goodsintids = goodsintids;
}
public List<Integer> getTypeintids() {
return typeintids;
}
public void setTypeintids(List<Integer> typeintids) {
this.typeintids = typeintids;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -2,6 +2,7 @@ package com.ruoyi.system.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -69,6 +70,9 @@ public class QuoteMaterial extends BaseEntity
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date updatedAt; private Date updatedAt;
private List<Integer> goodsintids;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -181,6 +185,14 @@ public class QuoteMaterial extends BaseEntity
this.priceMax = priceMax; this.priceMax = priceMax;
} }
public List<Integer> getGoodsintids() {
return goodsintids;
}
public void setGoodsintids(List<Integer> goodsintids) {
this.goodsintids = goodsintids;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -1,6 +1,7 @@
package com.ruoyi.system.domain; package com.ruoyi.system.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -48,6 +49,8 @@ public class QuoteMaterialType extends BaseEntity
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date updatedAt; private Date updatedAt;
private List<Integer> goodsintids;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -126,6 +129,14 @@ public class QuoteMaterialType extends BaseEntity
this.serviceName = serviceName; this.serviceName = serviceName;
} }
public List<Integer> getGoodsintids() {
return goodsintids;
}
public void setGoodsintids(List<Integer> goodsintids) {
this.goodsintids = goodsintids;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -16,6 +16,16 @@ export function getQuoteCraft(id) {
method: 'get' method: 'get'
}) })
} }
// 查询项目报价--服务工艺详细
export function selectQuoteTypeList(ids) {
return request({
url: '/system/QuoteCraft/selectQuoteTypeList',
method: 'post',
data: ids
})
}
// 新增项目报价--服务工艺 // 新增项目报价--服务工艺
export function addQuoteCraft(data) { export function addQuoteCraft(data) {

View File

@ -1,14 +1,15 @@
<template> <template>
<div> <div>
<SkuForm <el-card class="sku-main-card" shadow="never">
:source-attribute="sourceAttribute" <SkuForm
:attribute.sync="attribute" :source-attribute="sourceAttribute"
:sku.sync="sku" :attribute.sync="attribute"
:structure="structure" :sku.sync="sku"
ref="skuForm" :structure="structure"
:theme="2" ref="skuForm"
> :theme="2"
>
<template #score="slotProps"> <template #score="slotProps">
<div> <div>
<el-rate v-model="slotProps.row.score" /> <el-rate v-model="slotProps.row.score" />
@ -21,8 +22,7 @@
</div> </div>
</template> </template>
</SkuForm> </SkuForm>
</el-card>
</div> </div>
</template> </template>
@ -155,7 +155,6 @@ export default {
// 2. sku // 2. sku
// //
const specNames = Object.keys(attrs); const specNames = Object.keys(attrs);
console.log(specNames,this.sku)
// sku // sku
const skuList = (this.sku || []).map(row => { const skuList = (this.sku || []).map(row => {
@ -284,7 +283,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.upimg { .upimg {
display: flex; display: inline-flex;
align-items: center; align-items: center;
::v-deep .el-upload--picture-card { ::v-deep .el-upload--picture-card {
width: 60px !important; width: 60px !important;
@ -300,4 +299,12 @@ export default {
margin-right: 15px; margin-right: 15px;
} }
} }
.sku-main-card {
margin: 24px 0 24px 0;
background: #f8fafd;
border-radius: 10px;
border: 1px solid #e6e8eb;
box-shadow: 0 2px 8px 0 rgba(0,0,0,0.03);
}
</style> </style>

View File

@ -44,6 +44,7 @@
:value="item.name" :value="item.name"
style="width: 200px" style="width: 200px"
clearable clearable
@change="onAttributeNameChange(index, $event, item.name)"
> >
</el-input> </el-input>
</div> </div>
@ -81,6 +82,8 @@
v-model="scope.row.name" v-model="scope.row.name"
style="width: 150px" style="width: 150px"
clearable clearable
@focus="onAttributeNameFocus(scope)"
@blur="onAttributeNameBlur(scope.$index, $event, scope)"
> >
</el-input> </el-input>
</template> </template>
@ -104,7 +107,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="right"> <el-table-column align="right" width="280px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
@ -132,7 +135,16 @@
<div class="sku-list"> <div class="sku-list">
<el-form ref="form" :model="form" status-icon inline-message> <el-form ref="form" :model="form" status-icon inline-message>
<el-table :data="form.skuData" stripe border highlight-current-row > <!-- 表格区域只固定高度不做横向滚动和min-width限制 -->
<el-table
:data="form.skuData"
stripe
border
highlight-current-row
style="width: 100%;"
height="500px"
:header-cell-style="{ background: '#f5f7fa', color: '#333', fontWeight: 'bold' }"
>
<!-- 考虑到异步加载的情况如果 attribute 数据先加载完成则表头会立马展示效果不理想故使用emitAttribute 数据该数据为计算属性通过 myAttribute 生成结构与 attribute 一致 --> <!-- 考虑到异步加载的情况如果 attribute 数据先加载完成则表头会立马展示效果不理想故使用emitAttribute 数据该数据为计算属性通过 myAttribute 生成结构与 attribute 一致 -->
<el-table-column <el-table-column
v-if="emitAttribute.length > 0" v-if="emitAttribute.length > 0"
@ -191,7 +203,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-else-if="item.type == 'slot'" v-else-if="item.type == 'slot'"
:key="`structure-input-${index}-${scope.row.sku}`" :key="`structure-slot-${index}-${scope.row.sku}`"
:prop="'skuData.' + scope.$index + '.' + item.name" :prop="'skuData.' + scope.$index + '.' + item.name"
:rules="rules[item.name]" :rules="rules[item.name]"
> >
@ -232,6 +244,16 @@
</template> </template>
</el-table> </el-table>
</el-form> </el-form>
<!-- 批量设置价格和库存 -->
<el-card class="batch-set-card" shadow="never">
<div class="batch-set-row">
<el-input v-model="batchSetPrice" size="small" placeholder="批量设置价格" class="batch-input" />
<el-button size="small" type="primary" class="batch-btn" @click="onBatchSet('price')">批量设置价格</el-button>
<el-input v-model="batchSetStock" size="small" placeholder="批量设置库存" class="batch-input" />
<el-button size="small" type="success" class="batch-btn" @click="onBatchSet('stock')">批量设置库存</el-button>
</div>
</el-card>
<div class="sku-divider"></div>
</div> </div>
</div> </div>
</template> </template>
@ -320,6 +342,9 @@ export default {
skuData: [], skuData: [],
}, },
batch: {}, batch: {},
attributeNameMap: {},
batchSetPrice: '',
batchSetStock: '',
}; };
}, },
computed: { computed: {
@ -389,6 +414,12 @@ export default {
watch: { watch: {
myAttribute: { myAttribute: {
handler() { handler() {
// myAttribute _oldName
this.myAttribute.forEach((attr, idx) => {
if (!Object.prototype.hasOwnProperty.call(attr, '_oldName')) {
this.$set(this.myAttribute[idx], '_oldName', attr.name);
}
});
if (!this.isInit) { if (!this.isInit) {
// //
this.$emit("update:attribute", this.emitAttribute); this.$emit("update:attribute", this.emitAttribute);
@ -453,39 +484,89 @@ export default {
}, },
mounted() { mounted() {
!this.async && this.init(); !this.async && this.init();
// _oldName
this.myAttribute.forEach((attr, idx) => {
this.$set(this.myAttribute[idx], '_oldName', attr.name);
});
}, },
methods: { methods: {
delitem(row, index) { delitem(row, index) {
console.log(row, index); this.$confirm('确认删除该规格值吗?', '提示', {
row.item.splice(index, 1); confirmButtonText: '确定',
// row.item[index].checked=false; cancelButtonText: '取消',
// type: 'warning'
}).then(() => {
row.item.splice(index, 1);
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}, },
delsuk(index){ delsuk(index) {
this.myAttribute.splice(index,1) this.$confirm('确认删除该规格吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.myAttribute.splice(index, 1);
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}, },
addlist() { addlist() {
if (this.inputname) { if (!this.inputname.trim()) {
const flag = this.myAttribute.find((item) => { this.$message({
return item.name == this.inputname; type: "warning",
message: "请填写属性名称",
}); });
if (!flag) { return;
this.myAttribute.push({ name: this.inputname, item: [] });
this.inputname = "";
} else {
this.$message({
type: "warning",
message: "请勿添加相同规格",
});
}
} }
else{
this.$message({ if (this.inputname.includes(this.separator)) {
type: "warning", this.$message({
message: "请填属性名称", type: "warning",
}); message: `属性名称不允许包含「${this.separator}」字符`,
} });
return;
}
const flag = this.myAttribute.find((item) => {
return item.name === this.inputname;
});
if (flag) {
this.$message({
type: "warning",
message: "请勿添加相同规格",
});
return;
}
this.myAttribute.push({
name: this.inputname.trim(),
item: [],
canAddAttribute: true,
addAttribute: "",
_oldName: this.inputname.trim()
});
this.inputname = "";
this.$message({
type: "success",
message: "添加成功",
});
}, },
init() { init() {
this.$nextTick(() => { this.$nextTick(() => {
@ -583,13 +664,38 @@ export default {
if (index !== this.attribute.length - 1) { if (index !== this.attribute.length - 1) {
this.combinationAttribute(index + 1, dataTemp); this.combinationAttribute(index + 1, dataTemp);
} else { } else {
if (!this.isInit || this.async) { // 1. skuDatamapskukey
// sku sku sku sku sku const oldSkuMap = {};
for (let i = 0; i < this.form.skuData.length; i++) { this.form.skuData.forEach(row => {
for (let j = 0; j < dataTemp.length; j++) { oldSkuMap[row.sku] = row;
if (this.form.skuData[i].sku === dataTemp[j].sku) { });
dataTemp[j] = this.form.skuData[i]; // 2. sku
for (let j = 0; j < dataTemp.length; j++) {
// sku
if (oldSkuMap[dataTemp[j].sku]) {
//
this.structure.forEach((v) => {
if (!(v.type == "slot" && v.skuProperty == false)) {
dataTemp[j][v.name] = oldSkuMap[dataTemp[j].sku][v.name];
} }
});
} else {
// ""
// 1.
const skuArr = dataTemp[j].sku.split(this.separator);
// 2.
const oldAttrNames = Object.keys(this.form.skuData[0] || {}).filter(k => !this.structure.some(s => s.name === k) && k !== 'sku');
// 3. sku
let oldSku = '';
if (oldAttrNames.length === skuArr.length) {
oldSku = skuArr.join(this.separator);
}
if (oldSku && oldSkuMap[oldSku]) {
this.structure.forEach((v) => {
if (!(v.type == "slot" && v.skuProperty == false)) {
dataTemp[j][v.name] = oldSkuMap[oldSku][v.name];
}
});
} }
} }
} }
@ -626,7 +732,18 @@ export default {
} }
}, },
onBatchSet(type) { onBatchSet(type) {
if (this.batch[type] != "") { //
if (type === 'price' && this.batchSetPrice !== '') {
this.form.skuData.forEach((v) => {
v.price = this.batchSetPrice;
});
this.batchSetPrice = '';
} else if (type === 'stock' && this.batchSetStock !== '') {
this.form.skuData.forEach((v) => {
v.stock = this.batchSetStock;
});
this.batchSetStock = '';
} else if (this.batch[type] != "") {
this.form.skuData.forEach((v) => { this.form.skuData.forEach((v) => {
v[type] = this.batch[type]; v[type] = this.batch[type];
}); });
@ -638,15 +755,52 @@ export default {
// structure validate callback // structure validate callback
customizeValidate(rule, value, callback) { customizeValidate(rule, value, callback) {
let [model, index, name] = rule.field.split("."); let [model, index, name] = rule.field.split(".");
const row = this.form[model][index];
//
if (value === '' || value === null || value === undefined) {
callback(new Error(`${this.structure.find(s => s.name === name).label}不能为空`));
return;
}
//
if (name === 'price' || name === 'stock') {
if (isNaN(value) || value < 0) {
callback(new Error(`${this.structure.find(s => s.name === name).label}必须是非负数`));
return;
}
}
//
this.structure.forEach((v) => { this.structure.forEach((v) => {
if (v.name == name) { if (v.name === name && v.validate) {
v.validate(this.form[model], index, callback); v.validate(this.form[model], index, callback);
} }
}); });
callback();
}, },
// sku // sku
validate(callback) { validate(callback) {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (!valid) {
//
let errorMsg = '';
const formItems = this.$refs.form.fields || [];
formItems.forEach(item => {
if (item.validateState === 'error') {
// skuData.0.price
const match = item.prop && item.prop.match(/skuData\.(\d+)\.(\w+)/);
if (match) {
const rowIdx = Number(match[1]) + 1;
const colName = this.structure.find(s => s.name === match[2]);
errorMsg += `${rowIdx}行【${colName ? colName.label : match[2]}】未填写,`;
}
}
});
if (!errorMsg) errorMsg = '请完整填写所有必填项!';
this.$message.error(errorMsg.replace(/$/, ''));
}
callback(valid); callback(valid);
}); });
}, },
@ -674,7 +828,45 @@ export default {
}, },
getArray(){ getArray(){
return this.myAttribute return this.myAttribute
} },
onAttributeNameChange(index, newName, oldName) {
if (!newName || newName === oldName) return;
// 1.
if (this.myAttribute.some((attr, idx) => idx !== index && attr.name === newName)) {
this.$message.warning('属性名不能重复');
this.myAttribute[index].name = oldName;
return;
}
// 2. skuData key
this.form.skuData.forEach(row => {
if (row[oldName] !== undefined) {
row[newName] = row[oldName];
delete row[oldName];
}
});
// 3.
this.$forceUpdate();
},
onAttributeNameFocus(scope) {
//
scope.row._oldName = scope.row.name;
},
onAttributeNameBlur(index, event, scope) {
const newName = event.target.value.trim();
const oldName = scope.row._oldName || '';
if (!newName || newName === oldName) return;
//
if (this.myAttribute.some((attr, idx) => idx !== index && attr.name === newName)) {
this.$message.warning('属性名不能重复');
this.myAttribute[index].name = oldName;
return;
}
//
this.attributeNameMap[oldName] = newName;
this.myAttribute[index].name = newName;
this.$set(this.myAttribute[index], '_oldName', newName);
this.$forceUpdate();
},
}, },
}; };
</script> </script>
@ -712,11 +904,42 @@ export default {
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
border-bottom: 0; border-bottom: 0;
margin-bottom: 20px; margin-bottom: 20px;
background: #fafbfc;
border-radius: 6px;
overflow: hidden;
} }
} }
.sku-name { .sku-name {
text-align: right; text-align: right;
} }
.batch-set-card {
margin: 24px 0 8px 0;
background: #f8fafd;
border-radius: 8px;
border: 1px solid #e6e8eb;
box-shadow: 0 2px 8px 0 rgba(0,0,0,0.03);
.batch-set-row {
display: flex;
align-items: center;
gap: 18px;
padding: 12px 0 4px 0;
}
.batch-input {
width: 160px;
margin-right: 0;
}
.batch-btn {
min-width: 110px;
font-weight: bold;
letter-spacing: 1px;
}
}
.sku-divider {
height: 1px;
background: #eaeaea;
margin: 18px 0 8px 0;
border-radius: 1px;
}
.batch-set { .batch-set {
width: 100%; width: 100%;
margin-top: 5px; margin-top: 5px;
@ -725,6 +948,14 @@ export default {
line-height: initial; line-height: initial;
::v-deep .el-input__inner { ::v-deep .el-input__inner {
text-align: center; text-align: center;
border-radius: 4px;
background: #fff;
border: 1px solid #dcdfe6;
transition: border-color 0.2s;
&:focus {
border-color: #409eff;
box-shadow: 0 0 0 2px rgba(64,158,255,0.08);
}
} }
::v-deep .el-table__append-wrapper { ::v-deep .el-table__append-wrapper {
overflow: initial; overflow: initial;
@ -748,6 +979,39 @@ export default {
content: "*"; content: "*";
color: #f56c6c; color: #f56c6c;
} }
::v-deep .el-table__body .el-table__row td:nth-child(5) {
text-align: center;
vertical-align: middle;
}
::v-deep .el-upload {
display: flex;
justify-content: center;
align-items: center;
}
}
.sku-check {
padding: 10px 10px 0 10px;
.el-button.el-button--mini{
padding: 7px;
font-size: 12px;
}
.el-table,
.el-card {
font-size: 13px;
}
.el-input,
.el-card {
margin-bottom: 8px;
border-radius: 6px;
.el-card__header, .el-card__body {
padding: 8px 12px;
}
}
.el-table__row {
height: 32px;
}
} }
} }
</style> </style>

View File

@ -11,7 +11,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="服务项目" prop="goodId"> <el-form-item label="服务项目" prop="goodId">
<el-select v-model="queryParams.goodId" filterable placeholder="请选择服务项目" clearable> <el-select v-model="queryParams.goodsintids" filterable placeholder="请选择服务项目" clearable>
<el-option <el-option
v-for="type in typeDataList" v-for="type in typeDataList"
:key="type.id" :key="type.id"
@ -123,50 +123,49 @@
/> />
<!-- 添加或修改项目报价--服务工艺对话框 --> <!-- 添加或修改项目报价--服务工艺对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="服务" prop="goodId"> <el-form-item label="服务" prop="goodsintids">
<el-input v-model="form.goodId" type="textarea" placeholder="请输入内容" /> <el-select v-model="form.goodsintids" multiple filterable placeholder="请选择服务" style="width: 100%">
<el-option
v-for="(type, index) in typeDataList"
:key="type.id"
:label="type.title"
:value="type.id"
@click.native="handelSelectMultiple(type, index)"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="typeId"> <el-form-item label="类型" prop="intstrtypeList">
<el-input v-model="form.typeId" placeholder="请输入类型" /> <el-select v-model="form.intstrtypeList" multiple filterable placeholder="请选择类型" style="width: 100%">
<el-option
v-for="type in typeSelectDataList"
:key="type.id"
:label="type.title"
:value="type.id"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="标题" prop="title"> <el-form-item label="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入标题" /> <el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item> </el-form-item>
<el-form-item label="价格" prop="price"> <el-form-item label="价格" prop="price">
<el-input v-model="form.price" placeholder="请输入价格" /> <el-input-number v-model="form.price" :min="0" :step="0.01" :precision="2" placeholder="请输入价格" style="width: 100%" />
</el-form-item> </el-form-item>
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" /> <el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item> </el-form-item>
<el-form-item label="${comment}" prop="createdAt">
<el-date-picker clearable
v-model="form.createdAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="updatedAt">
<el-date-picker clearable
v-model="form.updatedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div class="dialog-footer" style="text-align:left;margin-top:20px;">
<el-button type="primary" @click="submitForm"> </el-button> <el-button @click="reset">重置</el-button>
<el-button @click="cancel"> </el-button> <el-button type="primary" @click="submitForm">提交</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listQuoteCraft, getQuoteCraft, delQuoteCraft, addQuoteCraft, updateQuoteCraft } from "@/api/system/QuoteCraft" import { listQuoteCraft, getQuoteCraft, delQuoteCraft, addQuoteCraft, updateQuoteCraft ,selectQuoteTypeList} from "@/api/system/QuoteCraft"
import { getGoodsDataList } from "@/api/system/QuoteType" import { getGoodsDataList } from "@/api/system/QuoteType"
export default { export default {
@ -187,6 +186,8 @@ export default {
total: 0, total: 0,
typeDataList: [], typeDataList: [],
typeSelectDataList: [],
// -- // --
QuoteCraftList: [], QuoteCraftList: [],
// //
@ -198,6 +199,8 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
goodId: null, goodId: null,
goodsintids: null,
intstrtypeList: null,
typeId: null, typeId: null,
title: null, title: null,
price: null, price: null,
@ -209,10 +212,11 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
goodId: [ goodsintids: [
{ required: true, message: "服务不能为空", trigger: "blur" } { required: true, message: "服务不能为空", trigger: "blur" }
], ],
typeId: [
intstrtypeList: [
{ required: true, message: "类型不能为空", trigger: "blur" } { required: true, message: "类型不能为空", trigger: "blur" }
], ],
title: [ title: [
@ -230,6 +234,7 @@ export default {
created() { created() {
this.getList(); this.getList();
this.getTypeList(); this.getTypeList();
this.getTypeList1();
}, },
methods: { methods: {
/** 查询项目报价--服务工艺列表 */ /** 查询项目报价--服务工艺列表 */
@ -260,6 +265,13 @@ export default {
} }
this.resetForm("form") this.resetForm("form")
}, },
//
handelSelectMultiple(position, index) {
var ids = this.form.goodsintids;
selectQuoteTypeList(ids).then(response => {
this.typeSelectDataList = response.data;
})
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
@ -287,6 +299,12 @@ export default {
this.typeDataList = response.data; this.typeDataList = response.data;
}) })
}, },
getTypeList1() {
selectQuoteTypeList("11").then(response => {
this.typeSelectDataList = response.data;
})
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset()

View File

@ -152,43 +152,34 @@
/> />
<!-- 添加或修改项目报价--物料信息对话框 --> <!-- 添加或修改项目报价--物料信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="服务项目" prop="goodId"> <el-form-item label="服务项目" prop="goodsintids">
<el-input v-model="form.goodId" type="textarea" placeholder="请输入内容" /> <el-select v-model="form.goodsintids" multiple filterable placeholder="请选择服务项目" style="width: 100%">
<el-option
v-for="type in typeDataList"
:key="type.id"
:label="type.title"
:value="type.id"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="typeId"> <el-form-item label="类型" prop="typeId">
<el-input v-model="form.typeId" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.typeId" placeholder="请输入类型" />
</el-form-item> </el-form-item>
<el-form-item label="标题" prop="title"> <el-form-item label="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入标题" /> <el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item> </el-form-item>
<el-form-item label="价格" prop="price"> <el-form-item label="价格" prop="price">
<el-input v-model="form.price" placeholder="请输入价格" /> <el-input-number v-model="form.price" :min="0" :step="0.01" :precision="2" placeholder="请输入价格" style="width: 100%" />
</el-form-item> </el-form-item>
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" /> <el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item> </el-form-item>
<el-form-item label="${comment}" prop="createdAt">
<el-date-picker clearable
v-model="form.createdAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="updatedAt">
<el-date-picker clearable
v-model="form.updatedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div class="dialog-footer" style="text-align:left;margin-top:20px;">
<el-button type="primary" @click="submitForm"> </el-button> <el-button @click="reset">重置</el-button>
<el-button @click="cancel"> </el-button> <el-button type="primary" @click="submitForm">提交</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -231,6 +222,7 @@ export default {
priceMin: null, priceMin: null,
priceMax: null, priceMax: null,
unit: null, unit: null,
goodsintids: null,
createdAt: null, createdAt: null,
updatedAt: null updatedAt: null
}, },
@ -238,7 +230,7 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
goodId: [ goodsintids: [
{ required: true, message: "服务项目不能为空", trigger: "blur" } { required: true, message: "服务项目不能为空", trigger: "blur" }
], ],
typeId: [ typeId: [

View File

@ -140,37 +140,31 @@
/> />
<!-- 添加或修改项目报价--物料分类对话框 --> <!-- 添加或修改项目报价--物料分类对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="服务项目" prop="goodsintids">
<el-select v-model="form.goodsintids" multiple filterable placeholder="请选择服务项目" style="width: 100%">
<el-option
v-for="type in typeDataList"
:key="type.id"
:label="type.title"
:value="type.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="名称" prop="title"> <el-form-item label="名称" prop="title">
<el-input v-model="form.title" placeholder="请输入名称" /> <el-input v-model="form.title" placeholder="请输入名称" />
</el-form-item> </el-form-item>
<el-form-item label="服务项目" prop="goodId">
<el-input v-model="form.goodId" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入排序" /> <el-input-number v-model="form.sort" :min="1" style="width: 120px;" />
</el-form-item> </el-form-item>
<el-form-item label="${comment}" prop="createdAt"> <el-form-item label="状态" prop="status">
<el-date-picker clearable <el-switch v-model="form.status" :active-value="1" :inactive-value="0" />
v-model="form.createdAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="updatedAt">
<el-date-picker clearable
v-model="form.updatedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div class="dialog-footer" style="text-align:left;margin-top:20px;">
<el-button type="primary" @click="submitForm"> </el-button> <el-button @click="reset">重置</el-button>
<el-button @click="cancel"> </el-button> <el-button type="primary" @click="submitForm">提交</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -214,6 +208,7 @@ export default {
goodId: null, goodId: null,
sort: null, sort: null,
status: null, status: null,
goodsintids: null,
createdAt: null, createdAt: null,
updatedAt: null, updatedAt: null,
priceMin: null, priceMin: null,
@ -226,7 +221,7 @@ export default {
title: [ title: [
{ required: true, message: "名称不能为空", trigger: "blur" } { required: true, message: "名称不能为空", trigger: "blur" }
], ],
goodId: [ goodsintids: [
{ required: true, message: "服务项目不能为空", trigger: "blur" } { required: true, message: "服务项目不能为空", trigger: "blur" }
], ],
sort: [ sort: [
@ -274,9 +269,9 @@ export default {
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
// goodId // goodId
if (Array.isArray(this.queryParams.goodId)) { // if (Array.isArray(this.queryParams.goodId)) {
this.queryParams.goodId = this.queryParams.goodId.map(String) // this.queryParams.goodId = this.queryParams.goodId.map(String)
} // }
// //
if ( if (
(this.queryParams.priceMin !== null && this.queryParams.priceMin !== '' && this.queryParams.priceMax !== null && this.queryParams.priceMax !== '') (this.queryParams.priceMin !== null && this.queryParams.priceMin !== '' && this.queryParams.priceMax !== null && this.queryParams.priceMax !== '')

View File

@ -21,7 +21,7 @@
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item label="服务项目" prop="goodId"> <el-form-item label="服务项目" prop="goodId">
<el-select v-model="queryParams.goodsids" filterable placeholder="请选择服务项目" clearable> <el-select v-model="queryParams.goodsintids" filterable placeholder="请选择服务项目" clearable>
<el-option <el-option
v-for="type in typeDataList" v-for="type in typeDataList"
:key="type.id" :key="type.id"
@ -140,8 +140,8 @@
<!-- 添加或修改项目报价--工艺分类对话框 --> <!-- 添加或修改项目报价--工艺分类对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="服务项目" prop="goodId"> <el-form-item label="服务项目" prop="goodsintids">
<el-select v-model="form.goodId" placeholder="请选择服务项目" style="width: 100%" multiple filterable> <el-select v-model="form.goodsintids" placeholder="请选择服务项目" style="width: 100%" multiple filterable>
<el-option <el-option
v-for="type in typeDataList" v-for="type in typeDataList"
:key="type.id" :key="type.id"
@ -211,7 +211,7 @@ export default {
title: [ title: [
{ required: true, message: "名称不能为空", trigger: "blur" } { required: true, message: "名称不能为空", trigger: "blur" }
], ],
goodId: [ goodsintids: [
{ required: true, message: "服务项目不能为空", trigger: "blur" } { required: true, message: "服务项目不能为空", trigger: "blur" }
], ],
sort: [ sort: [
@ -260,9 +260,9 @@ export default {
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
// goodId // goodId
if (Array.isArray(this.queryParams.goodId)) { // if (Array.isArray(this.queryParams.goodId)) {
this.queryParams.goodId = this.queryParams.goodId.map(String) // this.queryParams.goodId = this.queryParams.goodId.map(String)
} // }
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
@ -300,12 +300,12 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getQuoteType(id).then(response => { getQuoteType(id).then(response => {
const data = response.data const data = response.data
// goodId // // goodId
if (typeof data.goodId === 'string') { // if (typeof data.goodId === 'string') {
data.goodId = data.goodId.split(',').map(i => i.trim()).filter(i => i) // data.goodId = data.goodId.split(',').map(i => i.trim()).filter(i => i)
} else if (!Array.isArray(data.goodId)) { // } else if (!Array.isArray(data.goodId)) {
data.goodId = [] // data.goodId = []
} // }
this.form = data this.form = data
this.open = true this.open = true
this.title = "修改项目报价--工艺分类" this.title = "修改项目报价--工艺分类"