Merge branch 'dev' of https://git.yfgame.vip/r/hangtag into dev

This commit is contained in:
wwb 2024-12-16 15:27:30 +08:00
commit d680808be7
5 changed files with 50 additions and 33 deletions

View File

@ -26,12 +26,12 @@
<el-table-column width="300px" >
<template #header>
<div class="flex">
<div>{{ t('createOrder.skuColTitleCount') }}<span class="text-xs">({{totalCount}})</span></div>
<div>{{ t('createOrder.skuColTitleCount')+666 }}<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>
<template #default="scope">
<el-input-number v-model="scope.row.orderQty" min="1" />
<el-input-number @change="changeData" v-model="scope.row.orderQty" min="1" />
</template>
</el-table-column>
</el-table>
@ -145,13 +145,14 @@ const addItem = () => {
addRow();
}
const addRow=(row={})=>{
console.log( "formData.value",formData.value)
const tmpForm = formData.value ?? {};
that.tableList.push({
orderQty: 1,
//@ts-ignore
previewImage: formData.value.previewImage,
previewImage: tmpForm.previewImage,
draftDesignId: "",
...formData.value,
...tmpForm,
...row,
key: Math.random().toString(36).substring(2),
})
@ -163,17 +164,16 @@ useEmitt({
if(formData.value && that.tableList && that.tableList.length > 0
&& formData.value.productId === that.tableList[0].productId){
that = resetFields();
}
},
});
const init = (list = [])=>{
if(list){
that.tableList = [];
for (let i = 0; i < list.length; i++) {
addRow(list[i])
}
}
}
const querySearch = (queryString: string, cb: any) => {
const results = queryString ? that.itemList.filter(t => t.toString()

View File

@ -45,6 +45,7 @@
class="inline-input w-50"
:placeholder="t('createOrder.placeSkuInputSize')"
@select="handleSelect"
@change="changeData"
/>
</template>
@ -53,13 +54,13 @@
<template #header>
<div class="flex">
<div>
<span>{{('createOrder.skuColTitleCount')}}</span>
<span>{{t('createOrder.skuColTitleCount')}}</span>
<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>
<template #default="scope">
<el-input-number v-model="scope.row.orderQty" min="1" />
<el-input-number @change="changeData" v-model="scope.row.orderQty" min="1" />
</template>
</el-table-column>
</el-table>
@ -242,13 +243,14 @@ const addRow=(row={})=>{
}
}
}
const tmpForm = formData.value ?? {};
that.tableList.push({
orderQty: 1,
labelSize: "",
//@ts-ignore
previewImage: formData.value.previewImage,
previewImage: tmpForm.previewImage,
draftDesignId: "",
...formData.value,
...tmpForm,
...row,
key: Math.random().toString(36).substring(2),
})
@ -266,6 +268,7 @@ useEmitt({
});
const init = (list = [])=>{
if(list){
that.tableList = [];
for (let i = 0; i < list.length; i++) {
addRow(list[i])
}
@ -286,7 +289,7 @@ const querySearch = (queryString: string, cb: any) => {
cb(res)
}
const handleSelect = (item: RestaurantItem) => {
console.log(item)
changeData()
}
const selectable = (row:any) => {

View File

@ -4,8 +4,8 @@
<div>
<el-button
type="primary"
v-show="that.templateType === '1' && that.tableData.length > 0"
@click="addSku">{{t('createOrder.btnAddSku')}}
v-show="that.templateType !== '2' && that.tableData.length > 0"
@click="addSku">{{ t('createOrder.btnAddSku') }}
</el-button>
</div>
<div class="flex flex-wrap" v-if="that.templateType === '1'">
@ -48,6 +48,7 @@ import ProductItem3 from "./ProductItem3.vue"
import {ProductInfoApi} from "@/api/oms/productinfo";
import {useResetFields} from "@/hooks/ext";
import {useI18n} from "vue-i18n";
const {t} = useI18n()
const emit = defineEmits(['change'])
const productItem2Ref = ref();
@ -85,6 +86,9 @@ const addSku = () => {
propInfo: '{}', //
specInfo: JSON.parse(JSON.stringify(that.specInfo)),
})
if(that.templateType === '3'){
productItem3Ref.value.init(that.tableData);
}
}
const itemType = () => {
//
@ -94,13 +98,13 @@ const itemType = () => {
}
}
const init = (row) => {
that.tableData = row.productSkuList;
that.productId = row.productId
that.listKey = row.key
if (that.productId) {
//@ts-ignore
ProductInfoApi.getProductInfo(that.productId).then(res => {
console.log("res", res)
that.specInfo = {
specSizeWidth: res.specSizeWidth,
specSizeHeight: res.specSizeHeight,
@ -113,23 +117,30 @@ const init = (row) => {
if (res.templateType !== '1') {
that.cover = res.cover
}
console.log("that.tableData.length", that.tableData.length)
if (that.tableData.length === 0) {
addSku();
if (res.templateType === '2') {
//
setTimeout(() => {
productItem2Ref.value.init(that.tableData);
}, 100)
} else if (res.templateType === '3') {
//
setTimeout(() => {
if (res.templateType === '2') {
//
setTimeout(() => {
if (that.tableData.length === 0) {
addSku();
}
productItem2Ref.value.init(that.tableData);
}, 100)
} else if (res.templateType === '3') {
//
setTimeout(() => {
if (that.tableData.length === 0) {
addSku();
}else {
productItem3Ref.value.init(that.tableData);
}, 100)
}
}, 100)
} else {
if (that.tableData.length === 0) {
addSku();
}
}
})
}

View File

@ -34,10 +34,11 @@ const that = reactive({
selectRow: null,
})
const rowClick = (row) => {
console.log("init",row)
const tmp = JSON.parse(JSON.stringify(row))
that.selectRow = {
productSkuList: [],
...row,
...tmp,
}
//@ts-nocheck
skuListRef.value.init(that.selectRow)
@ -55,7 +56,6 @@ const changeDetails = (tableData)=>{
})
}
listRef.value.setSelectRow(that.selectRow)
}
const getTableData = () => {
@ -70,6 +70,7 @@ const getTableData = () => {
}
const init = (saleOrderEntry)=>{
listRef.value.init(saleOrderEntry)
}
defineExpose({
getTableData,

View File

@ -672,7 +672,8 @@ const submitPreHandler = (showMsg = true) => {
return;
}
item.productSkuList.forEach((item2, i2) => {
if (!item2.previewImage) {
console.log("item2",item2)
if (item2.productTemplateType === '1' && !item2.previewImage) {
const t = ` Please review row${index + 1} ${item.productName}SKU ${i2 + 1}`;
if (showMsg) {
useMessage().warning(t)
@ -804,6 +805,7 @@ onMounted(async () => {
...formData.value,
id: queryParams.id
}
console.log("res.saleOrderEntry",res.saleOrderEntry)
stepRef.value.init(res.saleOrderEntry ?? []);
}