Revert "fix(intake): allow assigned purchaser pricing push"
This reverts commit d3093aead7fae7726c3102236fbd40b4df11d8f9.
This commit is contained in:
parent
d3093aead7
commit
4b8e1d754a
@ -6567,81 +6567,6 @@ describe("NonIntegratedDetailClient", () => {
|
||||
expect(costPriceInput).toHaveValue("");
|
||||
});
|
||||
|
||||
it("lets the assigned purchaser use product pricing push controls", async () => {
|
||||
const actor = userEvent.setup();
|
||||
|
||||
saveNonIntegratedProduct(
|
||||
createProductRecord({
|
||||
id: "DNZ0001-product-pricing-assigned-purchaser",
|
||||
skuBatchConfirmedAt: CONFIRMED_SKU_BATCH_AT,
|
||||
purchaser: "采购同事",
|
||||
purchaseOwner: "采购同事",
|
||||
skuItems: [
|
||||
createSkuItem({
|
||||
id: "sku-pricing-assigned-purchaser-1",
|
||||
model: "SZ0230K01",
|
||||
skuCode: "SZ023001",
|
||||
barcode: "SZ023001N1280V01",
|
||||
setCount: "1",
|
||||
specName: "款式一 140/60/75",
|
||||
manufacturer: "兰考华兰家具",
|
||||
}),
|
||||
],
|
||||
factoryRows: [
|
||||
{
|
||||
skuId: "sku-pricing-assigned-purchaser-1",
|
||||
confirmed: true,
|
||||
model: "SZ0230K01",
|
||||
skuCode: "SZ023001",
|
||||
setCount: "1",
|
||||
barcode: "SZ023001N1280V01",
|
||||
specName: "款式一 140/60/75",
|
||||
size: "140/60/75",
|
||||
color: "胡桃色",
|
||||
material: "橡胶木",
|
||||
installMethod: "整装",
|
||||
supplierName: "兰考华兰家具",
|
||||
supplierCode: "N1280",
|
||||
warehouse: "",
|
||||
shippingMethod: "",
|
||||
minimumOrderQuantity: "",
|
||||
leadTime: "",
|
||||
assemblyMode: "",
|
||||
productionType: "",
|
||||
installationService: "",
|
||||
supplierCategory: "",
|
||||
purchaseOrderMethod: "",
|
||||
executeStandard: "GB/T3324-2024",
|
||||
},
|
||||
],
|
||||
}),
|
||||
);
|
||||
|
||||
render(
|
||||
<NonIntegratedDetailClient
|
||||
mode="edit"
|
||||
productId="DNZ0001-product-pricing-assigned-purchaser"
|
||||
currentUserRole="USER"
|
||||
currentUserName="采购同事"
|
||||
currentUserBusinessRoles={["PURCHASING"]}
|
||||
currentUserDepartmentPaths={[
|
||||
"江苏简尚品牌管理有限公司-供应链中心-采购部",
|
||||
]}
|
||||
initialDocumentWorkspaceCategory="产品核价"
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByTestId("product-pricing-workspace")).toBeInTheDocument();
|
||||
const costPriceInput = screen.getByPlaceholderText("0");
|
||||
expect(costPriceInput).not.toHaveAttribute("readonly");
|
||||
expect(screen.getByRole("button", { name: "确认推送" })).toBeDisabled();
|
||||
|
||||
await actor.type(costPriceInput, "88");
|
||||
|
||||
expect(screen.getByRole("button", { name: "确认推送" })).toBeEnabled();
|
||||
expect(screen.getByRole("button", { name: "批量确认推送" })).toBeEnabled();
|
||||
});
|
||||
|
||||
it("lets only admins reopen confirmed product factory rows before sample measurement is approved", async () => {
|
||||
const actor = userEvent.setup();
|
||||
const productId = "DNZ0001-product-factory-reopen";
|
||||
|
||||
@ -13087,15 +13087,8 @@ export default function NonIntegratedDetailClient({
|
||||
isIntakeNonIntegratedPricingGroupUser(currentPermissionUser);
|
||||
const isCurrentUserSupplyChainQualityGroup =
|
||||
isIntakeNonIntegratedQualityGroupUser(currentPermissionUser);
|
||||
const isCurrentUserProductPricingPurchaseOwner =
|
||||
isCurrentUserNonIntegratedPurchaseOwner(
|
||||
currentPermissionProduct,
|
||||
currentPermissionUser,
|
||||
);
|
||||
const canUseProductPricingPushControls =
|
||||
isCurrentUserAdmin ||
|
||||
isCurrentUserSupplyChainPricingGroup ||
|
||||
isCurrentUserProductPricingPurchaseOwner;
|
||||
isCurrentUserAdmin || isCurrentUserSupplyChainPricingGroup;
|
||||
const isCurrentUserPurchaseDownloadRestricted =
|
||||
hasCurrentUserContext &&
|
||||
!isCurrentUserFullDetailEditor &&
|
||||
@ -13614,10 +13607,6 @@ export default function NonIntegratedDetailClient({
|
||||
activePermissionWorkspaceCategory === PLANNING_LAYOUT_WORKSPACE_CATEGORY;
|
||||
const activeWorkspaceNodePermissionAccess =
|
||||
getNodePermissionAccessForCategory(activePermissionWorkspaceCategory);
|
||||
const canAssignedPurchaserEditProductPricingWorkspace =
|
||||
stockProductCanEditActiveWorkspace &&
|
||||
activePermissionWorkspaceCategory === PRODUCT_PRICING_WORKSPACE_CATEGORY &&
|
||||
isCurrentUserProductPricingPurchaseOwner;
|
||||
const canEditCurrentProduct =
|
||||
mode === "create"
|
||||
? !hasCurrentUserContext ||
|
||||
@ -13632,7 +13621,6 @@ export default function NonIntegratedDetailClient({
|
||||
!hasCurrentUserContext ||
|
||||
isCurrentUserAdmin ||
|
||||
isCurrentUserFullDetailEditor ||
|
||||
canAssignedPurchaserEditProductPricingWorkspace ||
|
||||
(mode === "create"
|
||||
? canEditCurrentProduct
|
||||
: stockProductCanEditActiveWorkspace &&
|
||||
|
||||
@ -478,13 +478,6 @@ export function canEditNonIntegratedWorkspace(
|
||||
return true
|
||||
}
|
||||
|
||||
if (
|
||||
normalizedCategory === PRODUCT_PRICING_WORKSPACE_CATEGORY &&
|
||||
isCurrentUserNonIntegratedPurchaseOwner(product, user)
|
||||
) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (
|
||||
PRICING_GROUP_WORKSPACE_CATEGORIES.has(normalizedCategory) &&
|
||||
isIntakeNonIntegratedPricingGroupUser(user)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user