新增 销售订单sku行备注,

This commit is contained in:
yf 2025-01-03 02:24:51 +08:00
parent 1fbc4ebe52
commit 22888ef18c
14 changed files with 296 additions and 110 deletions

View File

@ -68,6 +68,11 @@ public class SaleOrderSkuDTO implements Serializable {
*/
private String labelSize;
/**
* 备注
*/
private String remark;
/**
* 动态属性 排序信息
*/
@ -90,6 +95,8 @@ public class SaleOrderSkuDTO implements Serializable {
this.productTemplateType = saleOrderSkuDO.getProductTemplateType();
this.propInfo = saleOrderSkuDO.getPropInfo();
this.labelSize = saleOrderSkuDO.getLabelSize();
this.remark = saleOrderSkuDO.getRemark();
String specInfo1 = saleOrderSkuDO.getSpecInfo();
if(specInfo1 != null){
this.specInfo = JSONUtil.toBean(specInfo1, SpecInfoDTO.class);

View File

@ -108,4 +108,9 @@ public class SaleOrderSkuDO extends BaseDO {
*/
private String mainColor;
/**
* sku 备注
*/
private String remark;
}

View File

@ -162,7 +162,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
saleOrder.setOrderStatus(SaleOrderStatusEnum.YXD.getValue());
List<SaleOrderEntryDO> entrys = createReqVO.getEntrys();
String currency = null;
if(entrys!=null&&entrys.size()>0){
if (entrys != null && entrys.size() > 0) {
currency = entrys.get(0).getCurrency();
}
saleOrder.setCurrency(currency);
@ -331,10 +331,10 @@ public class SaleOrderServiceImpl implements SaleOrderService {
List<SaleOrderEntryDO> entrys = getSaleOrderEntryListByParentId(saleOrder.getId());
String contractType = saleOrder.getContractType();
String currencyType = saleOrder.getCurrencyType();
if(StringUtils.isBlank(contractType)){
if (StringUtils.isBlank(contractType)) {
throw new ServiceException(001, "合约类型不允许为空!");
}
if(StringUtils.isBlank(currencyType)){
if (StringUtils.isBlank(currencyType)) {
throw new ServiceException(001, "结算币种不允许为空!");
}
if (entrys == null || entrys.isEmpty()) {
@ -697,9 +697,9 @@ public class SaleOrderServiceImpl implements SaleOrderService {
.materialName(itemDTO.getProductName())
.qty(itemDTO.getOrderQty())
.deliveryDate(FuncUtil.timeToLocalDate(itemDTO.getDeliveryDate())).build();
if(FuncUtil.isNotEmpty(currency)){
if (FuncUtil.isNotEmpty(currency)) {
entry.setCurrency(currency);
BigDecimal price = productInfoService.queryPriceByProductId( entry.getMaterialId(),currency);
BigDecimal price = productInfoService.queryPriceByProductId(entry.getMaterialId(), currency);
// 查询默认单价
entry.setPrice(price);
}
@ -713,6 +713,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
saleOrderSkuDO.setEntryId(entry.getId());
saleOrderSkuDO.setProductTemplateType(saleOrderSkuDTO.getProductTemplateType());
saleOrderSkuDO.setSpecInfo(JSONUtil.toJsonStr(saleOrderSkuDTO.getSpecInfo()));
saleOrderSkuDO.setRemark(saleOrderSkuDTO.getRemark());
saleOrderSkuDO.setId(FuncUtil.getNextId());
skuList.add(saleOrderSkuDO);
}
@ -744,6 +745,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
List<SaleOrderEntryItemDTO> saleOrderEntry = dto.getSaleOrderEntry();
List<SaleOrderEntryDO> entryList = new ArrayList<>();
List<SaleOrderSkuDO> skuList = new ArrayList<>();
List<SaleOrderSkuDO> skuUpdateList = new ArrayList<>();
// 删除之前的的订单条目
deleteSaleOrderEntryByParentId(order.getId());
@ -758,9 +760,9 @@ public class SaleOrderServiceImpl implements SaleOrderService {
.materialName(itemDTO.getProductName())
.qty(itemDTO.getOrderQty())
.deliveryDate(FuncUtil.timeToLocalDate(itemDTO.getDeliveryDate())).build();
if(FuncUtil.isNotEmpty(currency)){
if (FuncUtil.isNotEmpty(currency)) {
entry.setCurrency(currency);
BigDecimal price = productInfoService.queryPriceByProductId(entry.getMaterialId(),currency);
BigDecimal price = productInfoService.queryPriceByProductId(entry.getMaterialId(), currency);
// 查询默认单价
entry.setPrice(price);
}
@ -775,14 +777,26 @@ public class SaleOrderServiceImpl implements SaleOrderService {
saleOrderSkuDO.setEntryId(entry.getId());
saleOrderSkuDO.setProductTemplateType(saleOrderSkuDTO.getProductTemplateType());
saleOrderSkuDO.setSpecInfo(JSONUtil.toJsonStr(saleOrderSkuDTO.getSpecInfo()));
saleOrderSkuDO.setRemark(saleOrderSkuDTO.getRemark());
saleOrderSkuDO.setId(FuncUtil.getNextId());
skuList.add(saleOrderSkuDO);
Long id1 = entry.getId();
if (FuncUtil.isNotEmpty(id1)) {
skuUpdateList.add(saleOrderSkuDO);
} else {
skuList.add(saleOrderSkuDO);
}
}
}
saleOrderMapper.updateById(order);
saleOrderEntryMapper.insertBatch(entryList);
skuOrderSkuMapper.insertBatch(skuList);
if (FuncUtil.isNotEmpty(skuList)) {
skuOrderSkuMapper.insertBatch(skuList);
}
if (FuncUtil.isNotEmpty(skuUpdateList)) {
skuOrderSkuMapper.insertOrUpdateBatch(skuUpdateList);
}
updateCustomerInvoiceData(order);
return order.getId();
}
@ -990,8 +1004,8 @@ public class SaleOrderServiceImpl implements SaleOrderService {
SaleContractSaveReqVO saveReqVO = new SaleContractSaveReqVO();
String billno = getNewOrderCode2();
String contractType = saleOrder.getContractType();
if(StringUtils.isNotBlank(contractType)){
billno = billno.replace("XXXX-",contractType+"-");
if (StringUtils.isNotBlank(contractType)) {
billno = billno.replace("XXXX-", contractType + "-");
}
/* // 优先使用销售订单合同号
String billno = saleOrder.getContractCode();
@ -1123,7 +1137,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
queryWrapper.orderByDesc(SaleOrderDO::getCreateTime);
queryWrapper.last("limit 1");
SaleOrderDO orderDO = saleOrderMapper.selectOne(queryWrapper);
if(FuncUtil.isNotEmpty(orderDO)){
if (FuncUtil.isNotEmpty(orderDO)) {
return orderDO.getBrandId();
}
return null;
@ -1181,15 +1195,15 @@ public class SaleOrderServiceImpl implements SaleOrderService {
private String getNewOrderCode2() {
String s = "";
int count = 10;
while (true){
count --;
while (true) {
count--;
try {
s = CodingRulesUtils.generateCode(saleContractCodeId, false);
checkCode2(null,s);
s = CodingRulesUtils.generateCode(saleContractCodeId, false);
checkCode2(null, s);
return s;
}catch (ServiceException e){
} catch (ServiceException e) {
log.warn("重复或者下一个编码");
if(count < 0){
if (count < 0) {
log.error("编码获取失败");
return "";
}
@ -1197,20 +1211,20 @@ public class SaleOrderServiceImpl implements SaleOrderService {
}
}
private void checkCode2(Long id,String code){
if(FuncUtil.isNotEmpty(code)){
private void checkCode2(Long id, String code) {
if (FuncUtil.isNotEmpty(code)) {
LambdaQueryWrapper<SaleContractDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.select(SaleContractDO::getId,SaleContractDO::getBillno, BaseDO::getDeleted);
lambdaQueryWrapper.select(SaleContractDO::getId, SaleContractDO::getBillno, BaseDO::getDeleted);
lambdaQueryWrapper.eq(SaleContractDO::getBillno, code);
lambdaQueryWrapper.eq(SaleContractDO::getDeleted,false);
lambdaQueryWrapper.eq(SaleContractDO::getDeleted, false);
List<SaleContractDO> dos = saleContractMapper.selectList(lambdaQueryWrapper);
if(FuncUtil.isEmpty(id) && FuncUtil.isNotEmpty(dos)){
if (FuncUtil.isEmpty(id) && FuncUtil.isNotEmpty(dos)) {
throw exception(GlobalErrorCodeConstants.DATA_DUPLICATE);
}
if (FuncUtil.isNotEmpty(id) && FuncUtil.isNotEmpty(dos)) {
for (SaleContractDO aDo : dos) {
// 出现重复并当前id 不一致
if(!FuncUtil.equals(aDo.getId(), id)){
if (!FuncUtil.equals(aDo.getId(), id)) {
throw exception(GlobalErrorCodeConstants.DATA_DUPLICATE);
}
}

View File

@ -3,8 +3,8 @@
<div>
<div style="max-height: 90vh; overflow:auto;" v-loading="loading">
<span>
{{ t('designInfo.tipsInfo')}}
<span style="color: #ff0000;font-size: 22px; padding-left: 4px">
*{{ t('designInfo.tipsInfo')}}
</span>
<div style="padding-bottom: 4px">
<el-checkbox style="margin: 8px" v-model="that.reView">
@ -1058,17 +1058,25 @@ const checkPropInfo = (info) => {
} else {
const infoList = washingInfoListByType(newInfo[key].groupType)
const infos = newInfo[key].dataInfo;
const showLabel1 = newInfo[key].dataInfo[0].showLabel
for (let j = 0; j < infos.length; j++) {
outerLoop: for (let i = 0; i < infoList.length; i++) {
const row1 = infoList[i];
for (let k = 0; k < row1.langMapping.length; k++) {
// icon url
if (infos[j].locale === row1.langMapping[k].locale) {
infos[j].label = row1.langMapping[k].value
break outerLoop;
console.log("newInfo[key].canInput",showLabel1,newInfo[key])
if( newInfo[key].canInput){
infos[j].label = showLabel1
}else{
outerLoop: for (let i = 0; i < infoList.length; i++) {
const row1 = infoList[i];
for (let k = 0; k < row1.langMapping.length; k++) {
// icon url
if (infos[j].locale === row1.langMapping[k].locale) {
infos[j].label = row1.langMapping[k].value
break outerLoop;
}
}
}
}
}
console.log("newArr99", infos)
newInfo[key].dataInfo = infos;

View File

@ -542,7 +542,7 @@ export default {
}
},
designInfo: {
"auditSubmitText": "Submit for Review",
"auditSubmitText": "Verify",
"auditTips": "This draft is only for content verification and is not the final print file.",
"cancelText": "Cancel",
"titlePreview": "Preview",
@ -661,7 +661,15 @@ export default {
"labelColOrderQty": "Order Quantity",
"tipsDuplicateSkipped": "Duplicate products skipped.",
"tipsAppendSuccess": "Added successfully.",
"btnAddSku": "Add SKU"
"btnAddSku": "Add SKU",
"tipsSkuError1": 'The SKU of the ', // The SKU of the
"tipsSkuError2": 'cannot be left blank.', //cannot be left blank.
"tipsSkuError3": 'Please review', //Please review
"placeRemark": "Please enter the Remark.",
"labelRemark": "Remark",
"viewOrder": "viewOrder",
"backHome": "BackHome",
"tipsDataChange": "DataChange Click Update Button",
},
"productDialogList": {
"title": "Product List",

View File

@ -658,6 +658,14 @@ export default {
tipsDuplicateSkipped: '已跳过重复产品',
tipsAppendSuccess: '添加成功',
btnAddSku: '添加SKU',
tipsSkuError1: 'SKU中 ', // The SKU of the
tipsSkuError2: '不能为空', //cannot be left blank.
tipsSkuError3: '请批稿', //Please review
labelRemark: "备注",
placeRemark: "请输入备注",
viewOrder: "查看订单",
backHome: "返回首页",
tipsDataChange: "数据已更新,请点击更新按钮",
},
productDialogList:{
title: '产品列表',

View File

@ -1,10 +1,11 @@
<!-- eslint-disable vue/this-in-template -->
<template>
<div>
<div style="max-height: 90vh; overflow:auto;" v-loading="loading">
<span>
{{ t('designInfo.tipsInfo')}}
<span style="color: #ff0000;font-size: 22px; padding-left: 4px">
*{{ t('designInfo.tipsInfo')}}
</span>
<div style="padding-bottom: 4px">
<el-checkbox style="margin: 8px" v-model="that.reView">
@ -302,26 +303,25 @@
</template>
<script lang="ts" setup name="DynamicPropConfig">
import {ElButton, ElLoading, ElMessageBox, ElSelect, ElSelectV2} from "element-plus";
// @ts-nocheck
import {ElButton, ElLoading, ElSelect, ElSelectV2} from "element-plus";
import {reactive, watch} from 'vue'
import {useMessage} from "@/hooks/web/useMessage";
import {DraftDesignDataApi} from "@/api/oms/draftdesigndata";
import DraftDesign from "@/components/DraftDesign/index.vue";
import {ShapeType} from "@/components/DraftDesign/config";
import {createImageViewer} from "@/components/ImageViewer";
import {ProductCareItemApi} from "@/api/oms/productcareitem";
import {replaceDomain} from "@/utils";
import * as FileApi from "@/api/infra/file";
import {useLocaleStore} from "@/store/modules/locale";
import {ProductInfoApi} from "@/api/oms/productinfo";
//@ts-ignore
import domtoimage from 'dom-to-image';
import {GroupTypeEnum} from "@/components/DraftDesign/config/constant";
import {useI18n} from "@/hooks/web/useI18n";
const {t} = useI18n()
//
const localeStore = useLocaleStore()
const emit = defineEmits(['change', 'initSucceed'])
const draftDesignEditRef = ref()
const that = reactive({
@ -371,7 +371,7 @@ const previewSize = computed(() => {
height: imageSize.value.height * 10
}
})
const currentLocale = computed(() => localeStore.getCurrentLocale)
watch(() => that.currentZoom, () => {
showPng();
})
@ -384,8 +384,8 @@ const querySearch = (queryString: string, cb: any) => {
const imageSize = computed(() => {
if (that.sizeInfo) {
return {
width: that.sizeInfo.width,
height: that.sizeInfo.height
// @ts-ignore
width: that.sizeInfo.width, height: that.sizeInfo.height
}
}
return {
@ -395,6 +395,7 @@ const imageSize = computed(() => {
})
const errorKeys = computed(() => {
if (that.errorList && that.errorList.length > 0) {
// @ts-ignore
return that.errorList.map(item => item.key)
}
return [];
@ -405,19 +406,16 @@ const errorItem = (key, index) => {
const errorInfo = (key, index) => {
if (that.errorList && that.errorList.length > 0) {
for (let i = 0; i < that.errorList.length; i++) {
// @ts-ignore
if (that.errorList[i].key === `${key}_${index}`) {
// @ts-ignore
return that.errorList[i].message
}
}
}
return ''
}
const imagePreview = (imgUrl: string) => {
createImageViewer({
zIndex: 9999999,
urlList: [imgUrl]
})
}
const getLabelName = (item) => {
if (item.shape === ShapeType.vueShapeImage) {
return item.groupName + "(icon):"
@ -447,12 +445,14 @@ const handleSelect = (index: number, key: string) => {
...info.dataInfo[index],
}
}
// @ts-ignore
const changeData = (index: number, key: string) => {
const info = that.propInfo[key];
const infoList = getIngredientInfoListByType(info.groupType)
let mapping = {}
for (let i = 0; i < infoList.length; i++) {
// @ts-ignore
mapping[infoList[i].label] = infoList[i].langMapping;
}
@ -501,6 +501,7 @@ const changeIconData = (index: number, key: string) => {
const infoList = washingInfoListByType(info.groupType)
let mapping = {}
for (let i = 0; i < infoList.length; i++) {
// @ts-ignore
mapping[infoList[i].label] = infoList[i].langMapping;
}
that.propInfo[key].processType = findProcessTypeIndex(index);
@ -508,24 +509,29 @@ const changeIconData = (index: number, key: string) => {
const allData = [...that.propInfo[key].dataInfo]
const fLang = allData[0].locale;
let m1 = mapping[allData[0].showLabel]
// @ts-ignore
let url = infoList[0].url
for (let i1 = 0; i1 < infoList.length; i1++) {
// @ts-ignore
if (infoList[i1].value === allData[0].showLabel) {
// @ts-ignore
url = infoList[i1].url
break;
}
}
allData[0].url = url
if (m1) {
// @ts-ignore
let ratio = allData[0].ratio
for (let i = 0; i < allData.length; i++) {
if (i > 0 && allData[i].locale === fLang) {
ratio = allData[i].ratio
m1 = mapping[allData[i].showLabel]
for (let i1 = 0; i1 < infoList.length; i1++) {
// @ts-ignore
if (infoList[i1].value === allData[i].showLabel) {
// @ts-ignore
url = infoList[i1].url
allData[0].url = url
break;
@ -553,7 +559,7 @@ const findProcessTypeIndex = (index) => {
for (let i = 0; i < that.propOrderByList.length; i++) {
//
// @ts-ignore
if (that.propOrderByList[i].shape === ShapeType.vueShapeImage) {
processType++;
if (index === i) {
@ -1058,17 +1064,25 @@ const checkPropInfo = (info) => {
} else {
const infoList = washingInfoListByType(newInfo[key].groupType)
const infos = newInfo[key].dataInfo;
const showLabel1 = newInfo[key].dataInfo[0].showLabel
for (let j = 0; j < infos.length; j++) {
outerLoop: for (let i = 0; i < infoList.length; i++) {
const row1 = infoList[i];
for (let k = 0; k < row1.langMapping.length; k++) {
// icon url
if (infos[j].locale === row1.langMapping[k].locale) {
infos[j].label = row1.langMapping[k].value
break outerLoop;
console.log("newInfo[key].canInput",showLabel1,newInfo[key])
if( newInfo[key].canInput){
infos[j].label = showLabel1
}else{
outerLoop: for (let i = 0; i < infoList.length; i++) {
const row1 = infoList[i];
for (let k = 0; k < row1.langMapping.length; k++) {
// icon url
if (infos[j].locale === row1.langMapping[k].locale) {
infos[j].label = row1.langMapping[k].value
break outerLoop;
}
}
}
}
}
console.log("newArr99", infos)
newInfo[key].dataInfo = infos;
@ -1279,9 +1293,14 @@ const changeType = () => {
const getPropInfo = () => {
//
return new Promise((resolve) => {
if( that.changeCount > 0){
useMessage().warning(t('designInfo.tipsDataChange'));
return;
}
that.errorList = []
that.changeCount = 0;
that.restInfo = {...that.propInfo}
checkPropInfo(that.propInfo).then(r => {
that.pageConfig.propOrderByList = that.propOrderByList
that.pageLoading = ElLoading.service({

View File

@ -542,7 +542,7 @@ export default {
}
},
designInfo: {
"auditSubmitText": "Submit for Review",
"auditSubmitText": "Verify",
"auditTips": "This draft is only for content verification and is not the final print file.",
"cancelText": "Cancel",
"titlePreview": "Preview",
@ -628,7 +628,7 @@ export default {
"ruleMsgEmail": "Please enter an email address.",
"tipsBaseInfo": "Please complete the basic information first.",
"tipsAddProduct": "Please add a product.",
"tipsLoadingEditing": "Successfully modified...",
"tipsLoadingEditing": "Successfully...",
"tipsLoadingOrderCompleted": "Order successfully placed...",
"skuTitleProductList": "Order Product List",
"skuTitleProductDetails": "Order Product Details",
@ -665,6 +665,12 @@ export default {
"tipsSkuError1": 'The SKU of the ', // The SKU of the
"tipsSkuError2": 'cannot be left blank.', //cannot be left blank.
"tipsSkuError3": 'Please review', //Please review
"placeRemark": "Please enter the Remark.",
"labelRemark": "Remark",
"viewOrder": "viewOrder",
"backHome": "BackHome",
"tipsDataChange": "DataChange Click Update Button",
},
"productDialogList": {
"title": "Product List",

View File

@ -661,6 +661,11 @@ export default {
tipsSkuError1: 'SKU中 ', // The SKU of the
tipsSkuError2: '不能为空', //cannot be left blank.
tipsSkuError3: '请批稿', //Please review
labelRemark: "备注",
placeRemark: "请输入备注",
viewOrder: "查看订单",
backHome: "返回首页",
tipsDataChange: "数据已更新,请点击更新按钮",
},
productDialogList:{
title: '产品列表',

View File

@ -5,8 +5,9 @@
<el-card class="el-card" >
<div class="badge" v-if="badge">{{ badge }}</div>
<div class="edit-btn">
<el-button link title="Edit" type="primary" @click.stop="openItem">
<el-button style="width: 260px;background-color: #ffa317" title="Edit" type="primary" @click.stop="openItem">
<Icon size="24" icon="ep:edit"/>
<span>Edit</span>
</el-button>
</div>
@ -34,17 +35,23 @@
{{ getSizeInfo }}
</div>
</el-form-item>
<el-form-item :label="t('createOrder.labelSkuSpecSizeThk')" v-if="formData.specInfo && formData.specInfo.specSizeThk">
<el-form-item :label="t('createOrder.labelRemark')" v-if="formData.specInfo">
<div>
<el-input v-model="formData.remark" @change="change" :placeholder="t('createOrder.placeRemark')" />
</div>
</el-form-item>
<el-form-item :label="t('createOrder.labelSkuSpecSizeThk')" v-if="formData.specInfo">
<div>
{{ formData.specInfo.specSizeThk }}
</div>
</el-form-item>
<el-form-item :label="t('createOrder.labelSkuSpecMaterial')" v-if="formData.specInfo && formData.specInfo.specMaterial">
<el-form-item :label="t('createOrder.labelSkuSpecMaterial')" v-if="formData.specInfo ">
<div>
{{ formData.specInfo.specMaterial }}
</div>
</el-form-item>
<el-form-item :label="t('createOrder.labelSkuMainColor')" v-if="formData.specInfo && formData.specInfo.mainColor">
<el-form-item :label="t('createOrder.labelSkuMainColor')" v-if="formData.specInfo">
<div>
{{ formData.specInfo.mainColor }}
</div>
@ -71,7 +78,7 @@
<script lang="ts" setup name="ProductItem1">
//@ts-nocheck
import {reactive, useModel, watch} from 'vue'
import { ref, watch} from 'vue'
import DesignPreviewDialog from "@/components/DraftDesign/components/DesignPreviewDialog.vue";
import {ShapeType} from "@/components/DraftDesign/config";
import {createImageViewer} from "@/components/ImageViewer";
@ -110,7 +117,14 @@ const getValue = (item:any) => {
}
return arr.join(";")
}
const formData = useModel(props, 'productInfo', emit)
const formData = ref({})
watch(() => props.productInfo, (newVal) => {
console.log("newVal",newVal)
formData.value = {
orderQty:1,
...newVal
}
}, {immediate: true, deep: true})
const delItem = () => {
useMessage().confirm(t("delDataMessage")).then(() => {
emit("delItem", formData.value)
@ -134,28 +148,37 @@ const propInfoOrderByList = computed(() => {
const previewUrl = computed(() => {
return formData.value.previewImage || ""
})
const submit = (data:any) => {
const init = ()=>{
formData.value.propInfo = JSON.stringify(data.propInfo);
formData.value.width = data.draftDesignData.pageConfig.editArea.width;
formData.value.height = data.draftDesignData.pageConfig.editArea.height;
formData.value.propOrderByList = data.propOrderByList;
formData.value.draftDesignId = data.draftDesignId;
formData.value.previewImage = data.previewImage;
formData.value.draftDesignInfo = {...data.draftDesignInfo};
}
const submit = (data:any) => {
console.log("data",data)
console.log("formData",formData)
const tmpData = {};
tmpData.propInfo = JSON.stringify(data.propInfo);
tmpData.width = data.draftDesignData.pageConfig.editArea.width;
tmpData.height = data.draftDesignData.pageConfig.editArea.height;
tmpData.propOrderByList = data.propOrderByList;
tmpData.draftDesignId = data.draftDesignId;
tmpData.previewImage = data.previewImage;
tmpData.draftDesignInfo = {...data.draftDesignInfo};
//
formData.value.specInfo = {
tmpData.specInfo = {
...formData.value.specInfo,
mainColor: formData.value.draftDesignInfo.label || "默认"
};
// 使
if(!formData.value.specInfo.specSizeWidth){
formData.value.specInfo.specSizeWidth = data.draftDesignData.pageConfig.editArea.width;
formData.value.specInfo.specSizeHeight = data.draftDesignData.pageConfig.editArea.height;
if(!tmpData.specInfo.specSizeWidth){
tmpData.specInfo.specSizeWidth = data.draftDesignData.pageConfig.editArea.width;
tmpData.specInfo.specSizeHeight = data.draftDesignData.pageConfig.editArea.height;
}
formData.value = {...formData.value,...tmpData};
console.log("tmpData@@",formData.value)
change();
}
const change = () => {
console.log("change@@",formData.value)
emit("update:productInfo", formData.value)
emit("change", formData.value)
}
const imagePreview = (imgUrl: string) => {
@ -164,6 +187,9 @@ const imagePreview = (imgUrl: string) => {
urlList: [imgUrl]
})
}
defineExpose({
init
})
</script>
<style lang="scss" scoped>

View File

@ -26,7 +26,7 @@
<el-table-column width="300px" >
<template #header>
<div class="flex">
<div>{{ t('createOrder.skuColTitleCount')+666 }}<span class="text-xs">({{totalCount}})</span></div>
<div>{{ t('createOrder.skuColTitleCount') }}<span class="text-xs">({{totalCount}})</span></div>
<div><el-input-number v-model="that.fullCount" v-show="that.tableList.length > 1" @change="fullQty"/> </div>
</div>
</template>
@ -34,6 +34,17 @@
<el-input-number @change="changeData" v-model="scope.row.orderQty" min="1" />
</template>
</el-table-column>
<el-table-column width="300px" >
<template #header>
<div class="flex">
<div>{{ t('createOrder.labelRemark') }}</div>
<div><el-input-number v-model="that.fullCount" v-show="that.tableList.length > 1" @change="fullQty"/> </div>
</div>
</template>
<template #default="scope">
<el-input @change="changeData" v-model="scope.row.remark" :placeholder="t('createOrder.placeRemark')" />
</template>
</el-table-column>
</el-table>
@ -137,6 +148,7 @@ const fullQty = (val) => {
}
}
});
changeData();
}).catch(() => {
//
});

View File

@ -63,6 +63,18 @@
<el-input-number @change="changeData" v-model="scope.row.orderQty" min="1" />
</template>
</el-table-column>
<el-table-column width="300px" >
<template #header>
<div class="flex">
<div>{{ t('createOrder.labelRemark') }}</div>
<div><el-input-number v-model="that.fullCount" v-show="that.tableList.length > 1" @change="fullQty"/> </div>
</div>
</template>
<template #default="scope">
<el-input @change="changeData" v-model="scope.row.remark" :placeholder="t('createOrder.placeRemark')" />
</template>
</el-table-column>
</el-table>
@ -226,6 +238,7 @@ const fullQty = (val) => {
}
}
});
changeData();
}).catch(() => {
//
});

View File

@ -13,8 +13,10 @@
<ProductItem1
@change="changeItem"
class="m-2"
ref="productItem1Ref"
@del-item="delItem"
:badge="`${index+1}`"
v-model:product-info="that.tableData[index]"/>
</template>
</div>
@ -41,7 +43,7 @@
</template>
<script lang="ts" setup name="ProductSkuList">
//@ts-nocheck
import ProductItem1 from "./ProductItem1.vue"
import ProductItem2 from "./ProductItem2.vue"
import ProductItem3 from "./ProductItem3.vue"
@ -51,6 +53,7 @@ import {useI18n} from "vue-i18n";
const {t} = useI18n()
const emit = defineEmits(['change'])
const productItem1Ref = ref();
const productItem2Ref = ref();
const productItem3Ref = ref();
@ -86,17 +89,13 @@ const addSku = () => {
propInfo: '{}', //
specInfo: JSON.parse(JSON.stringify(that.specInfo)),
})
if(that.templateType === '3'){
if(that.templateType === '2'){
productItem2Ref.value.init(that.tableData);
}if(that.templateType === '3'){
productItem3Ref.value.init(that.tableData);
}
}
const itemType = () => {
//
if (that.cover) {
//
}
}
const init = (row) => {
that.tableData = row.productSkuList;
@ -113,7 +112,8 @@ const init = (row) => {
mainColor: '',
}
that.templateType = res.templateType;
// 稿
that.cover = '';
// 稿 1 2 3
if (res.templateType !== '1') {
that.cover = res.cover
}
@ -121,10 +121,16 @@ const init = (row) => {
if (res.templateType === '2') {
//
setTimeout(() => {
console.log("that.tableData@@",that.tableData)
if (that.tableData.length === 0) {
addSku();
}else {
checkList().then(res=>{
productItem2Ref.value.init(that.tableData);
})
}
productItem2Ref.value.init(that.tableData);
}, 100)
} else if (res.templateType === '3') {
//
@ -132,13 +138,19 @@ const init = (row) => {
if (that.tableData.length === 0) {
addSku();
}else {
productItem3Ref.value.init(that.tableData);
checkList().then(res=>{
productItem3Ref.value.init(that.tableData);
})
}
}, 100)
} else {
if (that.tableData.length === 0) {
addSku();
}else {
checkList();
}
}
})
@ -146,7 +158,24 @@ const init = (row) => {
}
const changeItem = () => {
emit("change", that.tableData)
checkList().then(res=>{
console.log("changeItem that.tableData", that.tableData)
emit("change", that.tableData)
})
}
const checkList = ()=>{
if(that.tableData.length > 1){
const arr = [];
for (let i = 0; i < that.tableData.length; i++) {
//@ts-ignore
if(that.tableData[i].productId === that.productId){
arr.push(that.tableData[i])
}
}
that.tableData = arr
}
return Promise.resolve(that.tableData);
}
const changeList = (tableData) => {
that.tableData = tableData

View File

@ -694,20 +694,31 @@ const submitPreHandler = (showMsg = true) => {
const addNewBill = () => {
console.log("stepRef.value.getTableData()", stepRef.value.getTableData())
submitPreHandler().then(res => {
console.log("formData", formData.value)
console.log("formData222", formData.value)
if (formData.value.id) {
SaleOrderApi.editOrder(formData.value.id, {
...formData.value
}).then(res => {
that.pageLoading = ElLoading.service({
lock: true,
text: t('createOrder.tipsLoadingEditing'),
background: 'rgba(0,0,0,0.5)'
// that.pageLoading = ElLoading.service({
// lock: true,
// text: t('createOrder.tipsLoadingEditing'),
// background: 'rgba(0,0,0,0.5)'
// })
useMessage().confirm(t('createOrder.tipsLoadingEditing'),{
confirmButtonText: t('common.ok'),
cancelButtonText: t('common.close'),
type: 'success',
center: true,
}).then(res=>{
if(res){
push("/")
}else {
push("/order/sale-order")
}
}).catch(e => {
push("/order/sale-order")
})
setTimeout(() => {
that.pageLoading.close()
push("/")
}, 3000)
}).catch(e => {
useMessage().warning("Error" + e.message ? e.message : e)
})
@ -715,15 +726,30 @@ const addNewBill = () => {
SaleOrderApi.placeOrder({
...formData.value
}).then(res => {
that.pageLoading = ElLoading.service({
lock: true,
text: t('createOrder.tipsLoadingOrderCompleted'),
background: 'rgba(0,0,0,0.5)'
useMessage().confirm(t('createOrder.tipsLoadingOrderCompleted'),{
confirmButtonText: t('createOrder.backHome'),
cancelButtonText: t('createOrder.viewOrder'),
type: 'success',
center: true,
}).then(res=>{
if(res){
push("/")
}else {
push("/order/sale-order")
}
}).catch(e => {
push("/order/sale-order")
})
setTimeout(() => {
that.pageLoading.close()
push("/")
}, 3000)
// that.pageLoading = ElLoading.service({
// lock: true,
// text: t('createOrder.tipsLoadingOrderCompleted'),
// background: 'rgba(0,0,0,0.5)'
// })
// setTimeout(() => {
// that.pageLoading.close()
// push("/")
// }, 3000)
}).catch(e => {
useMessage().warning("Error" + e.message ? e.message : e)
})