|
@@ -105,10 +105,12 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
v-if="recommandVendor.length"
|
|
|
- label="Suggest Supplier"
|
|
|
- label-width="130px"
|
|
|
+ label="Frequently Used Supplier"
|
|
|
+ label-position="right"
|
|
|
+ label-width="180px"
|
|
|
>
|
|
|
<div class="flex flex-col items-start">
|
|
|
+ <!-- <div class="text-gray-400">最近10个PO的供应商列表</div> -->
|
|
|
<div
|
|
|
v-for="(item, index) in recommandVendor"
|
|
|
:key="index"
|
|
@@ -120,6 +122,66 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-show="preferSupplier.length"
|
|
|
+ class="pl-[12px]"
|
|
|
+ >
|
|
|
+ <div class="text-gray-400">
|
|
|
+ <span>Product Team Preferred Supplier</span>
|
|
|
+ <!-- <span class="text-sm"> (单击供应商名称快速选中)</span> -->
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in preferSupplier"
|
|
|
+ :key="item.sku"
|
|
|
+ class="flex text-sm"
|
|
|
+ :class="{
|
|
|
+ 'border border-gray-200 border-x-[0] border-t-[0] border-solid':
|
|
|
+ index + 1 === preferSupplier.length,
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="border border-solid border-gray-200 border-r-[0] border-b-[0] min-w-[100px] flex justify-center items-center"
|
|
|
+ >
|
|
|
+ {{ item.sku }}
|
|
|
+ </div>
|
|
|
+ <div class="flex-auto flex flex-col">
|
|
|
+ <div
|
|
|
+ v-for="subItem in item.list"
|
|
|
+ :key="subItem.id"
|
|
|
+ :style="{
|
|
|
+ backgroundColor:
|
|
|
+ subItem.Supplier.id === form.currentVendor
|
|
|
+ ? '#409eff'
|
|
|
+ : '#fff',
|
|
|
+ color:
|
|
|
+ subItem.Supplier.id === form.currentVendor
|
|
|
+ ? '#fff'
|
|
|
+ : '#333',
|
|
|
+ }"
|
|
|
+ class="border border-solid border-gray-200 border-b-[0] p-[6px] hover:bg-sky-100"
|
|
|
+ >
|
|
|
+ <el-tooltip
|
|
|
+ placement="right"
|
|
|
+ :content="subItem.Note"
|
|
|
+ :disabled="!subItem.Note"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="cursor-pointer"
|
|
|
+ @click="quickSelectSupplier(subItem.Supplier)"
|
|
|
+ >
|
|
|
+ <span>
|
|
|
+ {{ subItem.Supplier.name }}
|
|
|
+ </span>
|
|
|
+ <span v-if="subItem.Priority">
|
|
|
+ - {{ subItem.Priority }}
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="layout-right flex-auto">
|
|
@@ -1362,6 +1424,7 @@ import {
|
|
|
ElRadioGroup,
|
|
|
ElRadio,
|
|
|
ElMessageBox,
|
|
|
+ ElTooltip,
|
|
|
} from 'element-plus'
|
|
|
import type { FormInstance } from 'element-plus'
|
|
|
import { ShoppingCart, FolderAdd, Switch } from '@element-plus/icons-vue'
|
|
@@ -1919,6 +1982,13 @@ watch(computedVendor, () => {
|
|
|
computedVendor.value.Payment_Terms.length
|
|
|
) {
|
|
|
form.value.Supplier_Payment_Terms = computedVendor.value.Payment_Terms
|
|
|
+ // 选择供应商后, 对应的currency赋值到界面的Currency选项.
|
|
|
+ const temp: any[] = vendorList.value.filter(
|
|
|
+ (i) => i.value === form.value.currentVendor,
|
|
|
+ )
|
|
|
+ if (temp.length) {
|
|
|
+ form.value.Currency = temp[0].Currency || 'CNY'
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -2105,11 +2175,7 @@ const p1 = request
|
|
|
const route = useRoute()
|
|
|
const soOwner = ref('')
|
|
|
// 获取销售订单详情
|
|
|
-const p2 = request
|
|
|
- .post('/common/getSalesOrdersData', { id: route.params.id })
|
|
|
- .then((response) => {
|
|
|
- return response
|
|
|
- })
|
|
|
+const p2 = request.post('/common/getSalesOrdersDatV7', { id: route.params.id })
|
|
|
|
|
|
// 获取对 该so对应客户的标注 并弹窗提醒
|
|
|
const getAccountsData = async (id: string) =>
|
|
@@ -2205,7 +2271,7 @@ const p3 = request
|
|
|
currentCompany.value = 'PC'
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+const preferSupplier = ref([] as any[])
|
|
|
Promise.all([p1, p2, p3, getAccountsData])
|
|
|
.then((array: any[]) => {
|
|
|
// p2的数据处理逻辑从原本的p2then移动到这里处理.
|
|
@@ -2224,13 +2290,9 @@ Promise.all([p1, p2, p3, getAccountsData])
|
|
|
form.value.Reference = res.Reference || ''
|
|
|
form.value.Artwork_Link = res.Artwork_Link || ''
|
|
|
let temp = []
|
|
|
- if (res.details) {
|
|
|
- temp = res.details.filter(
|
|
|
- (item: any) => !productBlackList.includes(item.product_id),
|
|
|
- )
|
|
|
- } else if (res.Product_Details) {
|
|
|
- temp = res.Product_Details.filter(
|
|
|
- (item: any) => !productBlackList.includes(item.product.id),
|
|
|
+ if (res.Ordered_Items) {
|
|
|
+ temp = res.Ordered_Items.filter(
|
|
|
+ (item: any) => !productBlackList.includes(item.Product_Name.id),
|
|
|
)
|
|
|
}
|
|
|
|
|
@@ -2238,31 +2300,36 @@ Promise.all([p1, p2, p3, getAccountsData])
|
|
|
form.value.productList = []
|
|
|
recommandVendor.value = []
|
|
|
temp.forEach((item: any) => {
|
|
|
- getProductData(item.product.id).then((ctx) => {
|
|
|
+ getProductData(item.Product_Name.id).then((ctx) => {
|
|
|
console.log(ctx, 'product ctx')
|
|
|
form.value.productList.push(
|
|
|
Object.assign({}, emptyProductItem, {
|
|
|
candidate: [
|
|
|
{
|
|
|
- Product_Code: item.product_Product_Code,
|
|
|
- label: item.product.name,
|
|
|
- value: item.product.id,
|
|
|
+ Product_Code: item.Product_Name.Product_Code,
|
|
|
+ label: item.Product_Name.name,
|
|
|
+ value: item.Product_Name.id,
|
|
|
},
|
|
|
],
|
|
|
- Product_Code: item.product.Product_Code,
|
|
|
- id: item.product.id,
|
|
|
- name: item.product.name,
|
|
|
- label: item.product.name,
|
|
|
- value: item.product.id,
|
|
|
- desc: item.product_description || '',
|
|
|
- quantity: Number(item.quantity),
|
|
|
+ Product_Code: item.Product_Name.Product_Code,
|
|
|
+ id: item.Product_Name.id,
|
|
|
+ name: item.Product_Name.name,
|
|
|
+ label: item.Product_Name.name,
|
|
|
+ value: item.Product_Name.id,
|
|
|
+ desc: item.Description || '',
|
|
|
+ quantity: Number(item.Quantity),
|
|
|
requirement:
|
|
|
userInfo.value.Organization === 'PrimePac'
|
|
|
? '产品名称:\n尺寸:\n材质:\n工艺:\n颜色:\n其他备注:'
|
|
|
: ctx.CF3 || '',
|
|
|
CF_Product_Type: ctx.CF_Product_Type,
|
|
|
+ SO_Line_Item_Id: item.id,
|
|
|
}),
|
|
|
)
|
|
|
+ preferSupplier.value.push({
|
|
|
+ sku: item.Product_Name.Product_Code || '-',
|
|
|
+ list: ctx.Preferred_Supplier.slice() || [],
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
})
|